1

I have created an HA kubernetes cluster with kubeadm version 1.11.2 and installed calico CNI plugin which is up and running. I am trying to create a deployment with a docker image. It successfully created the deployment and created a container on the node but the container is failing to communicate to the outside world other than the node on which it's hosted (with the IP).

I have logged into the container and tried to ping the masters and other nodes it's failing.

Can anyone help me in resolving this issue?

1 Answer 1

1

Hard to tell, but has to be an issue with Calico/CNI. Are all your Calico pods ready on all your nodes, like this:

$ kubectl get pods -n kube-system
NAME                                                                 READY     STATUS    RESTARTS   AGE
calico-node-xxxxx                                                    2/2       Running   0          15h

You can check the CNI configs under /etc/cni/net.d Maybe your install-cni.sh container in your Calico pod didn't initialize the configs? For example:

{
  "name": "k8s-pod-network",
  "cniVersion": "0.3.0",
  "plugins": [
    {
      "type": "calico",
      "log_level": "info",
      "datastore_type": "kubernetes",
      "nodename": "<node-name>",
      "mtu": 1500,
      "ipam": {
        "type": "host-local",
        "subnet": "usePodCidr"
      },
      "policy": {
        "type": "k8s"
      },
      "kubernetes": {
        "kubeconfig": "/etc/cni/net.d/calico-kubeconfig"
      }
    },
    {
      "type": "portmap",
      "snat": true,
      "capabilities": {"portMappings": true}
    }
  ]
}

Normally, your container will have an interface and podCidr IP assigned to it, so after you shell into the pod/containers you can check with $ ifconfig

2
  • Thanks for the reply Rico. yeah, i can see all the calico pods are running fine and it initialized install-cni container and it's running. and i have verified the ip forwarding on all the nodes, it's enabled.
    – Raghu.k
    Oct 3, 2018 at 18:45
  • Do the pods/containers in question have a network interface?
    – Rico
    Oct 3, 2018 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.