Networking

Welcome to the jungle!

Deployments

Custom DNS nameservers

To specify a nameserver use this following template:

...
spec:
  containers:
    - name: ........
      image: ..........
...
  dnsPolicy: "None" #overide all configs
  dnsConfig:
    nameservers:
      - 8.8.8.8
      - 208.67.222.222
...

References

https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-configarrow-up-right

DNS troubleshoot

Then run.

Port forwarding

port-forward

proxy

Then access:

http://127.0.0.1:8001/api/v1/namespaces/MY-NAMESPACE/services/MY-SERVICE/proxy/

Known errors and solutions

Calico node 'XXXX' is already using the IPv4 address X.X.X.X

Problem

When you using kubespray, you remove a node:

Then you try to scale the cluster again, using the same node IP but with a different host name.

"calico-node" pod fails with the following error:

Solution

SSH to the master node, query etcd and check for the registries related to the "old" host name:

Sample output:

Analyse the registries than delete them:

Delete "calico-node" pod on the new node, it should start normally.

circle-info

If it does not work, try the following steps:

  • Remove the "old" node;

  • Delete its etcd registries;

  • Scale the cluster with the new node host name.

network plugin is not ready: cni config uninitialized

Problem

When trying to scale the cluster, the new node got disconnected in the middle of the process. When it came back, one the the CNI containers was returning the following error(s):

Solution

SSH to the node you are trying to add, get root, create the following file:

The content of the file should be its node hostname.

The CNI container should come up. If not, try deleting the pod (the replica set will recreated it automatically).

Last updated