add kubespray to the XTesting as it provides newer version of kubenetes and can be...
[it/test.git] / XTesting / kubespray / docs / flannel.md
1 # Flannel
2
3 Flannel is a network fabric for containers, designed for Kubernetes
4
5 **Warning:** You may encounter this [bug](https://github.com/coreos/flannel/pull/1282) 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](tests/testcases/040_check-network-adv.yml:31).
6
7 ## Verifying flannel install
8
9 * Flannel configuration file should have been created there
10
11 ```ShellSession
12 cat /run/flannel/subnet.env
13 FLANNEL_NETWORK=10.233.0.0/18
14 FLANNEL_SUBNET=10.233.16.1/24
15 FLANNEL_MTU=1450
16 FLANNEL_IPMASQ=false
17 ```
18
19 * Check if the network interface has been created
20
21 ```ShellSession
22 ip a show dev flannel.1
23 4: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default
24     link/ether e2:f3:a7:0f:bf:cb brd ff:ff:ff:ff:ff:ff
25     inet 10.233.16.0/18 scope global flannel.1
26        valid_lft forever preferred_lft forever
27     inet6 fe80::e0f3:a7ff:fe0f:bfcb/64 scope link
28        valid_lft forever preferred_lft forever
29 ```
30
31 * Try to run a container and check its ip address
32
33 ```ShellSession
34 kubectl run test --image=busybox --command -- tail -f /dev/null
35 replicationcontroller "test" created
36
37 kubectl describe po test-34ozs | grep ^IP
38 IP:                             10.233.16.2
39 ```
40
41 ```ShellSession
42 kubectl exec test-34ozs -- ip a show dev eth0
43 8: eth0@if9: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1450 qdisc noqueue
44     link/ether 02:42:0a:e9:2b:03 brd ff:ff:ff:ff:ff:ff
45     inet 10.233.16.2/24 scope global eth0
46        valid_lft forever preferred_lft forever
47     inet6 fe80::42:aff:fee9:2b03/64 scope link tentative flags 08
48        valid_lft forever preferred_lft forever
49 ```