<p>I have installed fresh Kubernetes 1.6.2 master on a single host and now trying to start Flannel using <a href="https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml" rel="nofollow noreferrer">https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml</a></p>

<p>The pod does not come up: </p>

<pre><code>$ 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)
</code></pre>

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

<p>Note that to install Kubernetes with flannel you need to specify the <code>--pod-network-cidr</code> flag. See <a href="https://kubernetes.io/docs/admin/kubeadm#kubeadm-init" rel="noreferrer">kubeadm init section</a></p>

<p>Example</p>

<pre><code>kubeadm init --pod-network-cidr=10.244.0.0/16
</code></pre>

<p>then as Menionned by Jordan, on some environments you need to install <a href="https://en.wikipedia.org/wiki/Role-based_access_control" rel="noreferrer">RBAC</a></p>

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

<p>If you are still having issues check that </p>

<ol>
<li><p>Make sure your cni plugin binaries are in place in /opt/cni/bin. You should see corresponding binaries for each CNI add-on</p></li>
<li><p>Make sure the CNI configuration file for the network add-on is in place under /etc/cni/net.d
[root@node1]# ls /etc/cni/net.d
10-flannel.conf</p></li>
<li><p>Run ifconfig to check docker, flannel bridge and virtual interfaces are up</p></li>
</ol>

<p>as mentionned here on github
<a href="https://github.com/kubernetes/kubernetes/issues/36575#issuecomment-264622923" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/36575#issuecomment-264622923</a></p>

<p>I have written a <a href="https://ronanquillevere.github.io/2017/05/16/kubernetes-ovh.html#.WSwwdxJ96V4" rel="noreferrer">complete blog post on the topic</a> if it can help.</p>
