Setting up the pod network

The networking of the cluster is the big-ticket item. The pods need to be able to talk to each other. That requires a pod network add-on. There are several options for this. Clusters generated by kubeadm, require a CNI-based add-on. I chose to use the Weave Net add-on, which supports the Network Policy resource. Your can choose whatever you like.

Run the following commands on the master VM:

vagrant@n1:~$ sudo sysctl net.bridge.bridge-nf-call-iptables=1
net.bridge.bridge-nf-call-iptables = 1vagrant@n1:~$ kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '
')"      

You should see the following:

serviceaccount "weave-net" created
clusterrole.rbac.authorization.k8s.io "weave-net" created
clusterrolebinding.rbac.authorization.k8s.io "weave-net" created
role.rbac.authorization.k8s.io "weave-net" created
rolebinding.rbac.authorization.k8s.io "weave-net" created
daemonset.extensions "weave-net" created

To verify, use the following:

vagrant@n1:~$ kubectl get po --all-namespaces 
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system etcd-n1 1/1 Running 0 2m
kube-system kube-apiserver-n1 1/1 Running 0 2m
kube-system kube-controller-manager-n1 1/1 Running 0 2m
kube-system kube-dns-86f4d74b45-jqctg 3/3 Running 0 3m
kube-system kube-proxy-l54s9 1/1 Running 0 3m
kube-system kube-scheduler-n1 1/1 Running 0 2m
kube-system weave-net-fl7wn 2/2 Running 0 31s

The last pod is our weave-net-fl7wn, which is what we're looking for, as well as the kube-dns pod. Both are running. All is well!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset