- Kubernetes:A Complete DevOps Cookbook
- Murat Karslioglu
- 286字
- 2025-04-04 13:20:39
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:
- Create a Kubernetes cluster with GKE using the jx command with the gke parameter as follows:
$ jx create cluster gke --skip-login
- Select your Google Cloud project; in our example, devopscookbook.
- Select us-central1-a when asked to pick a Google Cloud zone.
- Select Static Jenkins Server and Jenkinsfiles as the installation type.
- Enter your GitHub username:
Creating a local Git user for GitHub server
? GitHub username:
- 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:
- By default, Jenkins X will set the ingress rules to use the magic DNS nip.io domain:
? Domain [? for help] (your_IP.nip.io)
- Enter Yes to the following question:
? Do you wish to use GitHub as the pipelines Git server: (Y/n)
- Select the GitHub organization where you want to create the environment repository; in our case, k8devopscookbook.
- 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.