![]() |
VOOZH | about |
We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.
Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.
Follow TNS on your favorite social media networks.
Become a TNS follower on LinkedIn.
Check out the latest featured and trending stories while you wait for your first TNS newsletter.
First released in 2018, Jenkins X was created by James Strachan, creator of the Apache Groovy language. Currently managed by CloudBees, the purpose of this tool is to be a cloud-native, Kubernetes application to support CI/CD and simplify Kubernetes deployments. With just a single Jenkins X command, an admin can create a Kubernetes cluster, install the tools necessary to manage an application, create pipelines, and deploy an application to various environments.
Jenkins X is also an extensible automation server, configured by plugins, that function as a Continuous Integration (CI) server, a Continuous Deployment (CD) hub, and automated testing.
Jenkins X (also called JX) is easily installed on an existing cloud provider (such as Amazon Elastic Container Service for Kubernetes, Google Kubernetes Engine, or Microsoft Azure Kubernetes Service). Or, if you have an on-premises Kubernetes cluster, you can also make use of Jenkins X. With the jx command, you can quickly deploy clusters locally or to remote cloud providers (such as Google Cloud Platform).
I’m going to walk you through the process of installing Jenkins X on an existing Kubernetes cluster, running on Ubuntu Server 18.04.
I’m going to demonstrate deploying a Kubernetes cluster (using Jenkins X) both locally and to Google Cloud Platform. For this you’ll need:
Outside of that, just a little time.
Let’s make things happen.
Installing Jenkins X on Ubuntu is actually quite simple. The executable binary can be downloaded from the official Jenkins X GitHub page and then moved into the proper directory. To do this, either log into your server, via SSH, or into the console directly. Once you have a bash prompt for your server, issue the command:
curl -L "https://github.com/jenkins-x/jx/releases/download/$(curl --silent "https://github.com/jenkins-x/jx/releases/latest" | sed 's#.*tag/\(.*\)\".*#\1#')/jx-linux-amd64.tar.gz" | tar xzv "jx"
The above command will download the latest release of Jenkins X and then unpack the binary. Once the command completes, you should see an executable in the current working directory, named jx (Figure 1).
To move the Jenkins X binary, issue the command:
sudo mv jx /usr/local/bin
If you opt to deploy a cluster using a virtual machine environment, you’ll have to have that installed as well. For this, you can always install KVM, KVM-2, or VirtualBox. To make this easy, we’ll install VirtualBox. This does install an X server, but you don’t have to use it.
In order to install VirtualBox, issue the command:
sudo apt-get install virtualbox -y
This installation will take some time. Let it finish. Next, you’ll want to install minikube on your Ubuntu Server (as that will be our provider). To do this, download the necessary file with the command:
wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Change the permission of the downloaded file with the command:
chmod +x minikube-linux-amd64
Move (and rename) the file into the proper directory with the command:
sudo mv minikube-linux-amd64 /usr/local/bin/minikube
You should see that minikube is now installed with the command:
minikube version
The output will show the release number of minikube (Figure 2).
We’re now going to deploy a cluster. The cluster will use the minikube provider and VirtualBox as the driver. The command to deploy the cluster is:
jx create cluster minikube
You will be asked the following questions:
If you select the following options:
The effective command would be:
minikube start --memory 4096 --cpus 3 --disk-size 20GB --vm-driver virtualbox --bootstrapper=kubeadm
You can also deploy a cluster on a local environment without using a driver (selecting the none option). To do this, you must run the jx command with sudo like so:
sudo jx create cluster minikube --local-cloud-environment=true
Effectively, the command that will be run is:
minikube start --memory 4096 --cpus 3 --disk-size 20GB --vm-driver none --bootstrapper=kubeadm
The jx command will take care of pulling all of the necessary images and deploy the configured cluster.
Let’s say you want to deploy your cluster to the Google Cloud Platform. Jenkins X makes this possible as well. Before you do this, you must first have the gcloud application Installed. To do this, go back to your terminal window and download the source file with the command:
wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-265.0.0-linux-x86_64.tar.gz
Unpack the file with the command:
tar -zxf google-cloud-sdk-*
Change into the newly created directory with the command:
cd google-cloud-sdk
Finally, run the installer with the command:
./install.sh
Once you’ve taken care of that, update all things gcloud with the command:
gcloud components update
Finally, you must login to your Google Cloud Platform account with the command:
gcloud auth login
A link will print out. Open that link in a browser, select the Google account you wish to use, and then copy the verification code you are given. Paste that code into the command prompt and hit Enter. You are now logged into your Google Cloud Platform account and can issue the command:
jx create cluster gke --skip-login
When prompted, make sure you select the Google Cloud Project you wish to use (Figure 3).
Once you’ve made your selection and hit Enter, you’ll be prompted to select a zone (Figure 4).
Next, you’ll be asked the Jenkins installation type (choose from Serverless Jenkins X Pipelines with Tekton or Static Jenks Server with Jenkinsfiles). Do note, when using tekton, only kaniko is supported as a builder.
You’ll then have to enter a name and email address to use with git and then acquire the necessary API key for your GitHub account. That’s it. The cluster will deploy and is ready to work for you.
And that’s the gist of installing and using Jenkins X on an existing Kubernetes Cluster. There’s so much more that this tool can do, so I highly recommend combing through the official documentation.