<p>I have created a k8s cluster and network, using 1 master and 2 nodes. However during pod (nginx) deployment, the deployment happens only on one server i.e. node1 and not on other server i.e. node2, as the result shows below o/p</p>

<pre><code>[root@controller Kubernetes]# kubectl get pods -o wide
NAME    READY   STATUS    RESTARTS   AGE   IP            NODE    NOMINATED NODE   READINESS GATES
nginx   1/1     Running   0          10m   192.168.1.2   node1   &lt;none&gt;           &lt;none&gt;
[root@controller Kubernetes]#

</code></pre>

<p>which means nginx is deployed on only node1 and not on node2</p>

<p>Result of the nodes joining the master</p>

<pre><code>NAME         STATUS   ROLES    AGE    VERSION   INTERNAL-IP     EXTERNAL-IP   OS-IMAGE                KERNEL-VERSION               CONTAINER-RUNTIME
controller   Ready    master   142m   v1.16.0   192.168.33.20   &lt;none&gt;        CentOS Linux 7 (Core)   3.10.0-1062.1.1.el7.x86_64   docker://1.13.1
node1        Ready    &lt;none&gt;   134m   v1.16.0   192.168.33.10   &lt;none&gt;        CentOS Linux 7 (Core)   3.10.0-1062.1.1.el7.x86_64   docker://1.13.1
node2        Ready    &lt;none&gt;   46m    v1.16.0   192.168.33.30   &lt;none&gt;        CentOS Linux 7 (Core)   3.10.0-1062.1.1.el7.x86_64   docker://1.13.1
[root@controller Kubernetes]#
</code></pre>

<p>Pod file:</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
     name: nginx-web-application

spec:
  containers:
    - name: nginx-container
      image: nginx
</code></pre>

<p>I want to see the deployment happening on node2 as well when i run below command, can u please tell why it is not happening on both the nodes:</p>

<pre><code>kubectl create -f pod.yml
</code></pre>

Jagdish0886
<p>Your setup creates a pod with one container on one of the nodes (which one is decided by <a href="https://kubernetes.io/docs/concepts/overview/components/#kube-scheduler" rel="nofollow noreferrer">kube-scheduler</a>). </p>

<p>If you want to run that pod on each node use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer">DaemonSet</a> which ensures that a copy of a pod runs on each node.</p>

<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment" rel="nofollow noreferrer">Deployment</a> with 2 or more replicas should work since you have two nodes if both of your nodes are capable of running that pod (look at <a href="https://kubernetes.io/docs/concepts/overview/components/#kube-scheduler" rel="nofollow noreferrer">kube-scheduler</a>).</p>

<p>And last thing - you can use <a href="https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/" rel="nofollow noreferrer">Taints and Tolerations</a>. Easiest way would be to taint your <code>node1</code> to not allow shceduling pods on it (example from the documentation):</p>

<pre><code>kubectl taint nodes node1 key:NoSchedule-
</code></pre>
