<p>What is the usual way to organize pods in a cluster in Kubernetes?</p>

<p>I have a Jenkins build server, Docker registry, Git repository and other development tools that I want to run in Google Container Engine. Do I create one cluster for each of them? Or can multiple pods be scheduled on each node? </p>

<p>So my question is: Would you create one cluster that holds all these services, or multiple clusters?
The same question applies to production, qa etc enviroments. Do I create one cluster for each enviroment or do I have them in the same cluster?</p>

<p>Usually the pods are hosted by different nodes on our cluster depending on the resources the pod would need and also that the running pod may not overload the node. Moreover a single node in a cluster can host multiple pods.</p>

<p>Specific to the question,when talking about all the development tools all the pods here should be hosted on a single node only because all of them have to communicate with each other . When the question arises for different environments it would be wise to host them on different nodes but same cluster.</p>

<p>Kubernetes provides us with the added advantage of selecting nodes on which we wish to run our pods. The NodeSelector concept can come handy in this case.</p>

<pre><code>kubectl get nodes

kubectl get pods
</code></pre>

<p>Label any node that you have in your cluster :</p>

<pre><code>kubectl label nodes  gke-cluster1-default-pool-4db7fabf-zzx9 disktype=ccd

kubectl get nodes --show-labels
</code></pre>

<p>Now create a file to create a pod and mention the nodeSelector in that file.</p>

<p>nano task6pod.yaml</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
 name: pod6
 labels:
   env: test
spec:
  containers:
  - name: container6
    image: nginx
  nodeSelector:
   disktype: ccd
</code></pre>

<p>nodeSelector in this file is the same label as of the label of the node mentioned earlier.</p>

<pre><code>kubectl create -f task6pod.yaml

kubectl get pods -o wide
</code></pre>

<p>After this command you can see that the newly created pod will have the node that you wanted the one with the label.</p>
