Skip to content
Switch branches/tags
Go to file

Modify kube-flannel.yaml to use
8 contributors

Users who have contributed to this file

@vanou @alvaroaleman @tomdee @rajatchopra @mscherer @lentzi90 @athai @abhaydiwan


For information on deploying flannel manually, using the Kubernetes installer toolkit kubeadm, see Installing Kubernetes on Linux with kubeadm.

NOTE: If kubeadm is used, then pass --pod-network-cidr= to kubeadm init to ensure that the podCIDR is set.


The flannel manifest defines four things:

  1. A ClusterRole and ClusterRoleBinding for role based acccess control (RBAC).
  2. A service account for flannel to use.
  3. A ConfigMap containing both a CNI configuration and a flannel configuration. The network in the flannel configuration should match the pod network CIDR. The choice of backend is also made here and defaults to VXLAN.
  4. A DaemonSet for every architecture to deploy the flannel pod on each Node. The pod has two containers 1) the flannel daemon itself, and 2) an initContainer for deploying the CNI configuration to a location that the kubelet can read.

When you run pods, they will be allocated IP addresses from the pod network CIDR. No matter which node those pods end up on, they will be able to communicate with each other.


  • Allows to overwrite the public IP of a node. Useful if the public IP can not determined from the node, e.G. because it is behind a NAT. It can be automatically set to a nodes ExternalIP using the flannel-node-annotator

Older versions of Kubernetes

kube-flannel.yaml has some features that aren't compatible with older versions of Kubernetes, though flanneld itself should work with any version of Kubernetes.

For Kubernetes v1.6~v1.15

If you see errors saying found invalid field... when you try to apply kube-flannel.yaml then you can try the "legacy" manifest file

  • kubectl apply -f

This file does not bundle RBAC permissions. If you need those, run

  • kubectl apply -f

If you didn't apply the kube-flannel-rbac.yml manifest and you need to, you'll see errors in your flanneld logs about failing to connect.

  • Failed to create SubnetManager: error retrieving pod spec...

For Kubernetes v1.16

kube-flannel.yaml uses ClusterRole & ClusterRoleBinding of When you use Kubernetes v1.16, you should replace to because had become GA from Kubernetes v1.17.

The flannel CNI plugin

The flannel CNI plugin can be found in the CNI plugins repository. For additional details, see the README

Kubernetes 1.6 requires CNI plugin version 0.5.1 or later.


See troubleshooting