<p>I am trying to deploy my set of microservices in different nodes. For installing kubeadm and creation of clusters I am following the below documentations. </p>

<ol>
<li><a href="https://medium.com/@SystemMining/setup-kubenetes-cluster-on-ubuntu-16-04-with-kubeadm-336f4061d929" rel="nofollow noreferrer">https://medium.com/@SystemMining/setup-kubenetes-cluster-on-ubuntu-16-04-with-kubeadm-336f4061d929</a></li>
<li><a href="https://medium.com/@Grigorkh/install-kubernetes-on-ubuntu-1ac2ef522a36" rel="nofollow noreferrer">https://medium.com/@Grigorkh/install-kubernetes-on-ubuntu-1ac2ef522a36</a></li>
<li><a href="https://www.youtube.com/watch?v=b_fOIELGMDY&amp;t=108s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=b_fOIELGMDY&amp;t=108s</a></li>
</ol>

<p>I need one master with 2 worker machines. I got clear idea about how to create the kubernetes clusters.</p>

<p><strong>My requirements:</strong>  I have an application which has separate set of microservices. I need to deploy docker images for one set of microservices into one node1.And docker images for other set into node2. And 3 rd set of microservices in node3...etc...This is my planning of deployment. Please correct me if I am going in wrong direction, Since I only started exploration in docker, kubernetes and jenkins. Devop.</p>

<p><strong>My confusions:</strong></p>

<ol>
<li>According to my requirement region wise deployment by nodes , Is this deployment strategy is possible by Kubernetes ?  And is this one of the standard way ?</li>
<li>If I am using Jenkins for implementing CI/CD pipeline , then Do I need to install Jenkins in each Vm? Means master machine and also in machine which resides nodes?</li>
</ol>

<p>These all are my confusion about this Kubernetes deployment. Please correct me if my thoughts are wrong, since I am only a beginner in DevOp world. How can I clarify my doubts about deployment by using Kubernetes ?</p>

Mr.DevEng
<p>To answer your first question - you basically need to allocate each node for a tenant. If there are compliance/regulatory reasons then you should do it (Though it won't be very efficient). Here is how you can do it:</p>

<p>On the node1 add a taint: </p>

<pre><code>kubectl taint nodes node1.compute.companyname.com reservedfor=tenant1:NoSchedule
</code></pre>

<p>What above means is that the node1 will only schedule pods which have a matching toleration and not any other pod. For the microservice which you need to schedule on node1, you will have to add a toleration to the pod YAML file like:</p>

<pre><code>tolerations:
- key: "reservedfor"
  operator: "Equal"
  value: "tenant1"
  effect: "NoSchedule"
</code></pre>

<p>The same logic can be extended - so that even if tenant1 needs 4 machines, then all the 4 machines can be tainted with above key value pair and then pods can be tolerated on those nodes. Check out the documentation <a href="https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/" rel="nofollow noreferrer">here</a> and <a href="http://blog.infracloud.io/advanced-scheduling-kubernetes/" rel="nofollow noreferrer">blog with an example here</a></p>

<p>You can also use the <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/" rel="nofollow noreferrer">pod/node affinity</a> to achieve above. </p>

<p>Your second question on Jenkins - No, you don't need to install Jenkins on each node, but other than that more details are needed for that question.</p>
