Dynamic Jenkins Cluster
Sandeep Singh Rajawat
Former Business Technology Solutions Associate @ ZS Associate
Firstly edit this file “/lib/systemd/system/docker.service” on the host. Here we have to add “-H tcp://0.0.0.0:4252” on line no 14 as shown in Figure 01. By this, we can access the docker daemon service of the host machine in the Jenkins using port no. 4243.
Created a container image that’s has Linux and other basic configuration required to run Slave for Jenkins. When we launch the job it will automatically starts job on slave based on the label provided for dynamic approach.
Now we have to add details in cloud node for dynamic clustering.
Job 1
Pull the Github repo automatically when some developers push repo to Github and perform the following operations as:
1. Create the new image dynamically for the application and copy the application code into that corresponding docker image
2. Push that image to the docker hub
Job2
Launch the application on the top of Kubernetes cluster performing following operations:
1. If launching first time then create a deployment of the pod using the image created in the previous job. Else if deployment already exists then do rollout of the existing pod making zero downtime for the user.
2. If Application created first time, then Expose the application. Else don’t expose it.
Business Technology Solutions Associate Consultant @ ZS Pune
4 年Awesome ??