Installing flannel on Kubernete

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

Stand does not rise:

$ 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 also tried this using the default service account, but it won't show up.

+3


source to share


4 answers


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



+5


source


Note that you need to specify a flag to install Kubernetes with flannel --pod-network-cidr

. See section init kubeadm

Example

kubeadm init --pod-network-cidr=10.244.0.0/16

      

whereas Menionned by Jordan, in some environments you need to install RBAC

kubectl create -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel-rbac.yml

      



If you still have problems, check that

  • Make sure your plugin cni files are in / opt / cni / bin location. You should see the corresponding binaries for each CNI add-on

  • Make sure the CNI configuration file for the network add-on is in /etc/cni/net.d [root @ node1] # ls / etc / cni / net.d 10-flannel.conf

  • Run ifconfig to check docker, flannel bridge and virtual interfaces up

as mentioned here on github https://github.com/kubernetes/kubernetes/issues/36575#issuecomment-264622923

I wrote a complete blog post on the topic if it can help.

+3


source


For those who may be looking for this very recently, the most recent docs state that the correct provisioning team (for RBAC-compliant 1.7+) is:

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

      

Note that there are also instructions for older / non-RBAC versions , which states :

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/k8s-manifests/kube-flannel-legacy.yml

      

Please note that to install RBAC over the old version:

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/k8s-manifests/kube-flannel-rbac.yml

      

0


source


I run the command: kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml

This is error: Unable to connect to server: http: server gave an HTTP response to the HTTPS client

0


source







All Articles