Flannel installation on Kubernetes

Misko picture Misko · Apr 27, 2017 · Viewed 12k times · Source

I have installed fresh Kubernetes 1.6.2 master on a single host and now trying to start Flannel using https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml

The pod does not come up:

$ kubectl get pods kube-flannel-ds-l6gn4 --namespace kube-system   
NAME                    READY     STATUS             RESTARTS   AGE
kube-flannel-ds-l6gn4   1/2       CrashLoopBackOff   36         2h

$ kubectl logs kube-flannel-ds-l6gn4 --namespace kube-system kube-flannel
E0427 15:35:52.232093       1 main.go:127] Failed to create 
SubnetManager: error retrieving pod spec for 'kube-system/kube-flannel-ds-l6gn4': the server does not allow access to the requested resource (get pods kube-flannel-ds-l6gn4)

I've also tried this using the default serviceaccount, but it won't come up.

Answer

Jordan Liggitt picture Jordan Liggitt · Apr 27, 2017

If you are using the RBAC authorizer, you also need to create https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel-rbac.yml to set up the role and permissions for the flannel service account