In this step by step tutorial we are going to build a CI/CD solution for a modern cloud application based on microservices with Jenkins X. By the end of this tutorial, we will have a working CI/CD solution that will enable us to develop, test and deliver our application in a fast and reliable way.
- Continuous Deployment with Kubernetes and Jenkins X (Overview)
- Jenkins X Serveless Architecture (Chapter 1)
- You’re here → Install & Setup Jenkins X Serverless (Chapter 2)
- Import Existing Project into Jenkins X (Chapter 3)
- Create Custom Build Pack for Jenkins X (Chapter 4)
- Integration Testing in Jenkins X (Chapter 5)
In this chapter, we will install Jenkins X and use google cloud as our cloud provider, but the installation process is very similar to other clouds.
- Google cloud account (if you don’t already have one, you can create one here).
- Github account (if you don’t already have one, you can create one here).
Install Jenkins X on Google Kubernetes Engine (GKE)
- Log into your Google cloud account.
- Go to your console (console button at the right upper corner).
- Go to your cloud shell ([>_] button on the upper blue bar right side).
- Run the following commands to install jx:
mkdir -p ~/.jx/bin 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 -C ~/.jx/bin export PATH=$PATH:~/.jx/bin echo 'export PATH=$PATH:~/.jx/bin' >> ~/.bashrc
- Run the following command to:
- Deploy a fresh Kubernetes cluster configured for Jenkins X.
- Deploy serverless Jenkins X components.
jx create cluster gke --skip-login --git-public
- Now you will be asked a series of questions that will configure the installation:
- What project to associate your cluster with. Choose My First Project if you are a new google cloud user, or else choose the one you want.
- Where to deploy your cluster, geographical region. Choose the one closest to you.
- Machine type, if you’re not experienced just go with the default value.
- Number of nodes to deploy, same as above you can go with the default values.
- The kind of Jenkins X deployment you want, choose Serverless Jenkins X with Tekton Pipelines.
- You will be asked if you want to create a load balancer, agree to that, or else you will not be able to work.
- You will be asked if you want to use nip.io as your magic DNS, agree to that.
- Don’t forget the installation will create several repositories in your Github account and will ask for admin permissions, we strongly advise to create a fresh account for the purpose of the tutorial. You will be asked all sorts of questions about your Github account, answer accordingly, don’t use your email as the account name, this can make problems in later stages, use the nickname you chose for the account.
- The installation will start and when it is done, you will be presented with some useful links and the password for your Jenkins X related services, don’t forget to save it somewhere for future use.
That’s it! You are ready to start 💪
In the next chapter we will learn how to import an existing project into Jenkins X.
Let’s go Chapter 3!