Kubernetes with calico

10/9/2018

We are trying to set up IBM Datastage container makes use of two components Docker and Kubernetes. IBM used Kubernetes with Calico (pure IP networking fabric) as networking. IBM uses ansible + shell script to set up the deployment of InfoSphere DataStage in a containerized environment.

After we install calico pod on 3 node not running and also kube-dns is in the creating state.

NAMESPACE   NAME                                    READY STATUS           RESTARTS AGE
default     docker-registry-6d46c849dc-crx6p         1/1  Running             0     2h
kube-system calico-etcd-47b9q                        1/1  Running             0     2h
kube-system calico-kube-controllers-6fb8b4d696-62xmr 1/1  Running             0     9m
kube-system calico-node-5hrpj                        1/2  CrashLoopBackOff    31    2h
kube-system calico-node-bsldv                        1/2  CrashLoopBackOff    30    2h
kube-system calico-node-qfxt4                        1/2  CrashLoopBackOff    30    2h
kube-system etcd-k8snode1                            1/1  Running             0     2h
kube-system kube-apiserver-k8snode1.luc...           1/1  Running             0     2h
kube-system kube-controller-manager-k8s...           1/1  Running             0     2h
kube-system kube-dns-6f4fd4bdf-k6szc                 0/3  ContainerCreating   0     2h
kube-system kube-proxy-92869                         1/1  Running             0     2h
kube-system kube-proxy-pbpc4                         1/1  Running             0     2h
kube-system kube-proxy-sd5w5i                        1/1  Running             0     2h
kube-system kube-scheduler-k8snode1                  1/1  Running             0     2h
test-1      is-en-conductor-0                        0/1  ContainerCreating   0     2h
test-1      is-engine-compute-0                      0/1  ContainerCreating   0     2h
test-1      is-servicesdocker-pod-b54c55f8c-72d62    0/1  ContainerCreating   0     2h
test-1      is-xmetadocker-pod-68774595cb-crbwl      0/1  ContainerCreating   0     2h

Error in creating the calico-node and kube-dns...Can anyone help us?

-- paramagurus
calico
containers
datastage
docker
kubernetes

1 Answer

10/9/2018

It's likely that the PodCidr doesn't match 192.168.0.0/16 which is what Calico needs. This is doesn't guarantee that it will fix your problem, but in any case you can change it in your /etc/kubernetes/manifests/kube-controller-manager.yml:

...
containers:
- command:
  - kube-controller-manager
  - --address=127.0.0.1
  - --allocate-node-cidrs=true
  - --cloud-provider=aws
  - --cluster-cidr=192.168.0.0/16 <== Here.
...

Then edit the ConfigMap for your kube-proxy

$ kubectl -n kube-system edit configmap kube-proxy

apiVersion: v1
data:
  config.conf: |-
    apiVersion: kubeproxy.config.k8s.io/v1alpha1
    bindAddress: 0.0.0.0
    clientConnection:
      acceptContentTypes: ""
      burst: 10
      contentType: application/vnd.kubernetes.protobuf
      kubeconfig: /var/lib/kube-proxy/kubeconfig.conf
      qps: 5
    clusterCIDR: 192.168.0.0/16 <== change this
    configSyncPeriod: 15m0s
    ...

Then restart all the servers in your cluster.

Hope it helps.

-- Rico
Source: StackOverflow