kubeadm and weave not working together

4/4/2017

I deployed a single node kubernetes cluster with "kubeadm". This deployed Kubernetes 1.6. According to the instructions (https://kubernetes.io/docs/getting-started-guides/kubeadm/) I need to install a network layer for pod networking.

I decided to give "weave" a try, as this was easy to install according to the documentation (https://www.weave.works/weave-net-kubernetes-integration/) using a simple one-liner:

kubectl apply -f https://git.io/weave-kube

When I check the machine, I see there is a weave adapter now:

weave: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1376
        inet 10.32.0.1  netmask 255.240.0.0  broadcast 0.0.0.0
        inet6 fe80::bca7:f5ff:fefb:c7a2  prefixlen 64  scopeid 0x20<link>
        ether be:a7:f5:fb:c7:a2  txqueuelen 1000  (Ethernet)
        RX packets 12  bytes 780 (780.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9  bytes 690 (690.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I then deployed kube-dashboard with the provided yaml file:

kubectl create -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml

This went well, but the pod got an ip assigned from the 172.17.0.0 range. This is the range defined in the docker configuration file, not the one used by "weave".

This doesn't seem right to me. Shouldn't it get an ip in the weave range?

I've been researching the whole cni stuff, but the more I read the more I get confused on how all the different components (docker, weave, kubernetes, cni) are supposed to work together.

-- Jeroen Jacobs
kubernetes
weave

1 Answer

4/4/2017

What should happen is that Kubernetes should be installed with a flag to kubelet --network-plugin=cni, and then kubelet will look for a CNI config file in /etc/cni/net.d, and use the network config in that file to look for a CNI plugin (an executable) to call.

Installing Weave Net via kubectl apply -f https://git.io/weave-kube should create this config file (/etc/cni/net.d/10-weave.conf), and then after that pods should get an address in the Weave IP allocation range (by default 10.32.0.0/12)

Since you are seeing a pod with a Docker address, is it possible the --network-plugin=cni flag has gone missing?

-- Bryan
Source: StackOverflow