1

There are many for Cluster Networking in Kubernetes.

How can I inspect with kubeadm or kubectl which networking (flannel, calico, ..) gets used in my cluster?

Background: I play with K8s on some virtual machines.

guettli
  • 3,113
  • 14
  • 59
  • 110

2 Answers2

3

ls /etc/cni/net.d shows the CNI plugins you have installed and configured.

A. Darwin
  • 427
  • 1
  • 4
2

CNI configuration is found under /etc/cni/net.d. But there can be many plugin configurations found under /etc/cni/net.d, so it depends on the weightage of the file. The plugin-file with highest weightage(in name) is applied.

Example: in this case file 20-* will be chosen.

10-weave.conflist
20-weave.conflist

The name and type filed of the plugin configuration file specifies which plugin to be applied from the /opt/cni/bin/ folder.

sudo cat /etc/cni/net.d/20-weave.conflist
{
    "cniVersion": "0.3.0",
    "name": "weave",
    "plugins": [
        {
            "name": "weave",
            "type": "weave-net",
            "hairpinMode": true
        },
        {
            "type": "portmap",
            "capabilities": {"portMappings": true},
            "snat": true
        }
    ]
}

Verify the created pods using this command: kubectl get pods -n kube-system

weave-net-cc6np                    2/2     Running   6 (30m ago)   17d
weave-net-mkvzd                    2/2     Running   5 (33m ago)   17d
Rajesh Dutta
  • 306
  • 1
  • 5