Kubernetes helps in managing the pods running by itself, hence we do not require to monitor the pods or do the load balancing part (Orchestration). It also provides us with a persistent volume feature that helps us make our data persistent.

Here, in this blog, I have shared how to create a continuous integration and deployment pipeline using Kubernetes, Github, and Jenkins. As the developer uploads the code on Github, this pipeline automatically starts the respective language interpreter installed image container to deploy code on top of Kubernetes ( eg. If code is of PHP, then Jenkins should start the container that has PHP already installed).

Once the pod is launched, the code is copied to the pod for deployment, and pod is exposed. Once exposed the pod is tested for successful exposing of pod and working of code.

If the pod fails to deploy the code an error email is sent to the developer.

Here I have also used the PVC concept of Kubernetes to make my data persistent.

Now let us see how it is done ……

  1. First, a job github-pull is created in Jenkins to download the code from GitHub which was uploaded by the developer.

Image for post

files uploaded by the developer

For this, the repository address is given in the Source Code Management section. This job has enabled poll SCM build triggers so that it automatically downloads the code from Github. The files downloaded are saved in folder /var/lib/jenkins/workspace/github-pull of the local system by default.

#github #containers #kubernetes #jenkins #ci-cd-pipeline

CI/CD pipeline integrating Kubernetes, Github and Jenkins
5.25 GEEK