Flannel

Flannel is a network fabric for containers, designed for Kubernetes

Warning: You may encounter this bug with VXLAN backend, while waiting on a newer Flannel version the current workaround (ethtool --offload flannel.1 rx off tx off) is showcase in kubespray networking test.

Verifying flannel install

  • Flannel configuration file should have been created there
  1. cat /run/flannel/subnet.env
  2. FLANNEL_NETWORK=10.233.0.0/18
  3. FLANNEL_SUBNET=10.233.16.1/24
  4. FLANNEL_MTU=1450
  5. FLANNEL_IPMASQ=false
  • Check if the network interface has been created
  1. ip a show dev flannel.1
  2. 4: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default
  3. link/ether e2:f3:a7:0f:bf:cb brd ff:ff:ff:ff:ff:ff
  4. inet 10.233.16.0/18 scope global flannel.1
  5. valid_lft forever preferred_lft forever
  6. inet6 fe80::e0f3:a7ff:fe0f:bfcb/64 scope link
  7. valid_lft forever preferred_lft forever
  • Try to run a container and check its ip address
  1. kubectl run test --image=busybox --command -- tail -f /dev/null
  2. replicationcontroller "test" created
  3. kubectl describe po test-34ozs | grep ^IP
  4. IP: 10.233.16.2
  1. kubectl exec test-34ozs -- ip a show dev eth0
  2. 8: eth0@if9: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1450 qdisc noqueue
  3. link/ether 02:42:0a:e9:2b:03 brd ff:ff:ff:ff:ff:ff
  4. inet 10.233.16.2/24 scope global eth0
  5. valid_lft forever preferred_lft forever
  6. inet6 fe80::42:aff:fee9:2b03/64 scope link tentative flags 08
  7. valid_lft forever preferred_lft forever