Creating a Jenkins X Kubernetes cluster

You may prefer other cloud vendors or on-premises deployment. For this recipe, we will use GKE. See the Jenkins X documentation for other vendor instructions.

Let's perform the following steps to create your first Jenkins X Kubernetes cluster using jx:

  1. Create a Kubernetes cluster with GKE using the jx command with the gke parameter as follows:
$ jx create cluster gke --skip-login
  1. Select your Google Cloud project; in our example, devopscookbook.
  2. Select us-central1-a when asked to pick a Google Cloud zone.
  3. Select Static Jenkins Server and Jenkinsfiles as the installation type.
  4. Enter your GitHub username:
Creating a local Git user for GitHub server
? GitHub username:
  1. Enter your GitHub API token. Go to the GitHub Token page at https://github.com/settings/tokens/new?scopes=repo,read:user,read:org,user:email,write:repo_hook,delete_repo to get your API token:
Please click this URL and generate a token
https://github.com/settings/tokens/new?scopes=repo,read:user,read:org,user:email,write:repo_hook,delete_repo
Then COPY the token and enter it following:
? API Token:
  1. By default, Jenkins X will set the ingress rules to use the magic DNS nip.io domain: 
? Domain [? for help] (your_IP.nip.io)
  1. Enter Yes to the following question:
? Do you wish to use GitHub as the pipelines Git server: (Y/n)
  1. Select the GitHub organization where you want to create the environment repository; in our case, k8devopscookbook.
  1. You will see a message similar to the following when your Deployment is successful:
Jenkins X installation completed successfully
********************************************************
NOTE: Your admin password is: your_password
********************************************************
...
Context "gke_devopscookbook_us-central1-a_slayersunset" modified.
NAME HOSTS ADDRESS PORTS AGE
chartmuseum chartmuseum.jx.your_IP.nip.io your_IP 80 7m43s
docker-registry docker-registry.jx.your_IP.nip.io your_IP 80 7m43s
jenkins jenkins.jx.your_IP.nip.io your_IP 80 7m43s
nexus nexus.jx.your_IP.nip.io your_IP 80 7m43s

You can also find your admin password in the preceding output.