<p>I was able to setup the Kubernetes Cluster on Centos7 with one master and two worker nodes, however when I try to deploy a pod with nginx, the state of the pod stays in ContainerRunning forever and doesn't seem to get out of it.</p>

<p>For pod network I am using the calico.
Can you please help me resolve this issue? for some reason I don't feel satisfied moving forward without resolving this issue, I tried to check forums etc, since the last two days and this is the last resort that I am reaching out to you.</p>

<pre><code>[root@kube-master ~]# kubectl get pods --all-namespaces
[get pods result][1]
</code></pre>

<p>However when I run describe pods I see the below error for the nginx container under events section.</p>

<pre><code>Warning  FailedCreatePodSandBox  41s (x8 over 11m)     kubelet,
kube-worker1  (combined from similar events): Failed to create pod
sandbox: rpc error: code = Unknown desc = failed to set up sandbox
container
"ac77a42270009cba0c508e2fd82a84d6caef287bdb117d288d5193960b52abcb"
network for pod "nginx-6db489d4b7-2r4d2": networkPlugin cni failed to
set up pod "nginx-6db489d4b7-2r4d2_default" network: unable to connect
to Cilium daemon: failed to create cilium agent client after 30.000000
seconds timeout: Get http:///var/run/cilium/cilium.sock/v1/config:
dial unix /var/run/cilium/cilium.sock: connect: no such file or
directory
</code></pre>

<p>Hope you can help here.</p>

<p><strong>Edit 1:</strong></p>

<p>The ip address of the master VM is <code>192.168.40.133</code></p>

<p>Used the below command to initialize the kubeadm:
<code>kubeadm init --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address 192.168.40.133</code></p>

<p>Used the below command to install the pod network:
<code>kubectl apply -f https://docs.projectcalico.org/v3.11/manifests/calico.yaml</code></p>

<p>The <code>kubeadm init</code> above gave me the join command that I used to join the workers into the cluster.</p>

<p>All the VMs are connected to host and bridged network adapters.</p>

Dileep Kumar Manduva
<p>your pod subnet (specified by <code>--pod-network-cidr</code>) clashes with the network your VMs are located in: these 2 have to be distinct. Use something else for the pod subnet, for example <code>10.244.0.0/16</code> and then edit calico.yaml before applying it as described in <a href="https://docs.projectcalico.org/getting-started/kubernetes/installation/calico#installing-with-the-kubernetes-api-datastore50-nodes-or-less" rel="nofollow noreferrer">the official docs</a>:</p>

<pre><code>POD_CIDR="10.244.0.0/16"
kubeadm init --pod-network-cidr=${POD_CIDR} --apiserver-advertise-address 192.168.40.133
curl https://docs.projectcalico.org/manifests/calico.yaml -O
sed -i -e "s?192.168.0.0/16?${POD_CIDR}?g" calico.yaml
kubectl apply -f calico.yaml
</code></pre>

<p>hope this helps :)</p>

<p>note: you don't really need to specify <code>--apiserver-advertise-address</code> flag: <code>kubeadm</code> will detect correctly the main IP of the machine most of the time.</p>
