30fa4944417fc04d1c33d68df215dfe3b28e54bc
[it/test.git] / XTesting / kubespray / docs / weave.md
1 # Weave
2
3 Weave 2.0.1 is supported by kubespray
4
5 Weave uses [**consensus**](https://www.weave.works/docs/net/latest/ipam/##consensus) mode (default mode) and [**seed**](https://www.weave.works/docs/net/latest/ipam/#seed) mode.
6
7 `Consensus` mode is best to use on static size cluster and `seed` mode is best to use on dynamic size cluster
8
9 Weave encryption is supported for all communication
10
11 * To use Weave encryption, specify a strong password (if no password, no encryption)
12
13 ```ShellSession
14 # In file ./inventory/sample/group_vars/k8s_cluster.yml
15 weave_password: EnterPasswordHere
16 ```
17
18 This password is used to set an environment variable inside weave container.
19
20 Weave is deployed by kubespray using a daemonSet
21
22 * Check the status of Weave containers
23
24 ```ShellSession
25 # From client
26 kubectl -n kube-system get pods | grep weave
27 # output
28 weave-net-50wd2                       2/2       Running   0          2m
29 weave-net-js9rb                       2/2       Running   0          2m
30 ```
31
32 There must be as many pods as nodes (here kubernetes have 2 nodes so there are 2 weave pods).
33
34 * Check status of weave (connection,encryption ...) for each node
35
36 ```ShellSession
37 # On nodes
38 curl http://127.0.0.1:6784/status
39 # output on node1
40 Version: 2.0.1 (up to date; next check at 2017/08/01 13:51:34)
41
42         Service: router
43        Protocol: weave 1..2
44            Name: fa:16:3e:b3:d6:b2(node1)
45      Encryption: enabled
46   PeerDiscovery: enabled
47         Targets: 2
48     Connections: 2 (1 established, 1 failed)
49           Peers: 2 (with 2 established connections)
50  TrustedSubnets: none
51
52         Service: ipam
53          Status: ready
54           Range: 10.233.64.0/18
55   DefaultSubnet: 10.233.64.0/18
56 ```
57
58 * Check parameters of weave for each node
59
60 ```ShellSession
61 # On nodes
62 ps -aux | grep weaver
63 # output on node1 (here its use seed mode)
64 root      8559  0.2  3.0 365280 62700 ?        Sl   08:25   0:00 /home/weave/weaver --name=fa:16:3e:b3:d6:b2 --port=6783 --datapath=datapath --host-root=/host --http-addr=127.0.0.1:6784 --status-addr=0.0.0.0:6782 --docker-api= --no-dns --db-prefix=/weavedb/weave-net --ipalloc-range=10.233.64.0/18 --nickname=node1 --ipalloc-init seed=fa:16:3e:b3:d6:b2,fa:16:3e:f0:50:53 --conn-limit=30 --expect-npc 192.168.208.28 192.168.208.19
65 ```
66
67 ## Consensus mode (default mode)
68
69 This mode is best to use on static size cluster
70
71 ### Seed mode
72
73 This mode is best to use on dynamic size cluster
74
75 The seed mode also allows multi-clouds and hybrid on-premise/cloud clusters deployment.
76
77 * Switch from consensus mode to seed/Observation mode
78
79 See [weave ipam documentation](https://www.weave.works/docs/net/latest/tasks/ipam/ipam/) and use `weave_extra_args` to enable.