<p>I am trying to implement CI/CD pipeline by using Kubernetes and Jenkins. I am planning to use Kubernetes HA Cluster having  3 master and 5 worker machine / node. </p>

<p>Now I am exploring about the implementation tutorials for CI/CD Pipeline. And also exploring about the Jenkins usage with Kubernetes HA Cluster. When I am reading , I felt little bit confusions about Jenkins. That I am adding here.</p>

<p><strong>1.</strong> I have total 8 VMs - 3 Master and 5 Worker machines / nodes (Kubernetes cluster). If I installing Jenkins in any one worker machines , then is there any problem while integrating with CI/CD pipeline for deployment ?</p>

<p><strong>2.</strong> I am previously readed the following link for understanding the implementations,</p>

<p><a href="https://dzone.com/articles/easily-automate-your-cicd-pipeline-with-jenkins-he" rel="nofollow noreferrer">https://dzone.com/articles/easily-automate-your-cicd-pipeline-with-jenkins-he</a></p>

<p>Is this mandatory to use Jenkins master and slave ?. In this tutorial showing that If kubectl,helm and docker is installed then don't need to use Jenkins slave. What is the idea about master and slave here?</p>

<p><strong>3.</strong> If I am installing both jenkins master and slave in kubernetes cluster worker machine / node , then Need to install master and slave in separate separate VMs? I have still confusion about where to install Jenkins?</p>

<p>I am just started on CI/CD pipeline - Kubernetes and Jenkins.</p>

Mr.DevEng
<p>Jenkins has two parts. There's the master, which manages all the jobs, and the workers, which perform the jobs.</p>

<p>The Jenkins master supports many kinds of workers (slaves) via plugins - you can have stand alone nodes, Docker based slaves, Kubernetes scheduled Docker slaves, etc.</p>

<p>Where you run the Jenkins master doesn't really matter very much, what is important is how you configure it to run your jobs.</p>

<p>Since you are on Kubernetes, I would suggest checking out the <a href="https://github.com/jenkinsci/kubernetes-plugin" rel="nofollow noreferrer">Kubernetes plugin for Jenkins</a>. When you configure the master to use this plugin, it will create a new Kubernetes pod for each job, and this pod will run the Docker based <a href="https://hub.docker.com/r/jenkinsci/slave/" rel="nofollow noreferrer">Jenkins slave image</a>. The way this works is that the plugin watches for a job in the job queue, notices there isn't a slave to run it, starts the Jenkins slave docker image, which registers itself with the master, then it does the job, and gets deleted. So you do not need to directly create slave nodes in this setup.</p>

<p>When you are in a Kubernetes cluster in a container based workflow, you don't need to worry about where to run the containers, let Kubernetes figure that out for you. Just use Helm to launch the Jenkins master, then connect to the Jenkins master and configure it to use Kubernetes slaves.</p>
