Integrating Jenkins and Kubernetes to Deploy website

We are going to deploy an infrastructure with all the powerful features of Kubernetes , like deployment,service,pvc to host a website.We are also going to use Jenkins for CI/CD.

Workflow:

1.Create container image that’s has Jenkins installed using dockerfile Or You can use the Jenkins Server on RHEL 8/7

docker build -t jenkins:1
docker run -it -p 1234:8080 --name jenk jenkins:1

Job 1:

In this job we pull the data from GitHub, and copy it to our local repository.

Job 2 :

In this job ,jenkins first check the language of the code , It It has interpreter of it then It will launch deployment ,Service,and pvc on the kubernetes server to launch the website,If It don’t find the suitable Interpreter , It will show “ Code is not compatable”.

Job 3 :

Job 3 will be auto triggered after the successful build of job 2.In this job Jenkins will get the pod name from the kubernetes server, so that it can copy the website code to the pods, so that client can get the website.

Job 4 :

This job will also triggered by the successful build of job 3,This job is for testing, To test the website is live or not.If not then it will trigger a job that send mail to developer .

Job 5:

This job will be triggered if test fails.It will send the mail to developer.

Tech learner

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store