Jenkins X is a CI / CD platform for Kubernetes. Jenkins X offers you the possibility to create or import applications, automatically built them and deploy them to Kubernetes. Each code change will results in a new deploy of your application, all automated because of the hooks.

In this tutorial I'll show you create a new Kubernetes cluster using Jenkins X . After the installation we will introduce CI / CD for a simple Spring Boot Rest Service from my GitHub. After I deploy  him in a pod in  staging environment, scale the amount of pods and promote the application to production environment.

Prerequisites :

Install a Kubernetes cluster using Jenkins X

$ brew update
$ brew tap jenkins-x/jx
$ brew install jx
$ jx --version


Create new project or use existing project, in my case the project name is  devops-project (id = devops-project-225710 ) and the Kubernetes cluster is  devops-project-kubernetes

Create a default Kubernetes cluster using jx .

$ jx create cluster gke --skip-login --default-admin-password=xxxxxx -n devops-projet-kubernetes




Your Kubernetes context is now set to the namespace: jx 
To switch back to your original namespace use: jx namespace default
For help on switching contexts see:

To import existing projects into Jenkins:       jx import
To create a new Spring Boot microservice:       jx create spring -d web -d actuator
To create a new microservice from a quickstart: jx create quickstart

When everything is running, your browser will automatically open . Just be patient. There will follow an automated login and your Jenkins instance will be configured automatically.

In my case

The install will also create two repositories and push them to your GitHub account.

Import our Spring Boot  application as a pipeline with Jenkins X

Now execute jx import

It’s also possible to import a git project using a URL.

$ jx import --url

Execute the commands which are returned in the output above.

Created Jenkins Project: