c12s-kubespray/docs/weave.md

75 lines
2 KiB
Markdown
Raw Normal View History

2017-07-27 12:40:52 +00:00
Weave
=======
Weave 2.0.1 is supported by kubespray
2017-07-31 11:23:01 +00:00
Weave uses [**consensus**](https://www.weave.works/docs/net/latest/ipam/#initialization) mode (default mode) and [**seed**](https://www.weave.works/docs/net/latest/ipam/#initialization) mode.
2017-07-27 12:40:52 +00:00
2017-07-31 11:28:47 +00:00
`Consensus` mode is best to use on static size cluster and `seed` mode is best to use on dynamic size cluster
2017-07-31 11:23:01 +00:00
Weave encryption is supported for all communication
2017-07-28 09:33:13 +00:00
2017-07-31 11:23:01 +00:00
* To use Weave encryption, specify a strong password (if no password, no encrytion)
2017-07-28 09:33:13 +00:00
2017-07-27 12:40:52 +00:00
```
# In file ./inventory/group_vars/k8s-cluster.yml
weave_password: EnterPasswordHere
```
2017-07-31 11:23:01 +00:00
This password is used to set an environment variable inside weave container.
2017-07-28 09:33:13 +00:00
2017-07-31 11:23:01 +00:00
Weave is deployed by kubespray using daemonSet
2017-07-28 09:33:13 +00:00
2017-07-27 12:40:52 +00:00
* Check the status of Weave containers
2017-07-28 09:33:13 +00:00
2017-07-27 12:40:52 +00:00
```
2017-07-31 11:23:01 +00:00
# From client
2017-07-27 12:40:52 +00:00
kubectl -n kube-system get pods | grep weave
```
2017-07-28 09:33:13 +00:00
2017-07-31 11:23:01 +00:00
* Check status of weave (connection,encryption ...) for each node
2017-07-28 09:33:13 +00:00
2017-07-27 12:40:52 +00:00
```
2017-07-31 11:23:01 +00:00
# On nodes
2017-07-27 12:40:52 +00:00
curl http://127.0.0.1:6784/status
```
2017-07-31 11:23:01 +00:00
* Check parameters of weave for each node
2017-07-28 09:33:13 +00:00
```
2017-07-31 11:23:01 +00:00
# On nodes
2017-07-28 09:33:13 +00:00
ps -aux | grep weaver
```
2017-07-27 12:40:52 +00:00
### Consensus mode (default mode)
2017-07-28 09:33:13 +00:00
2017-07-31 11:23:01 +00:00
This mode is best to use on static size cluster
2017-07-27 12:40:52 +00:00
### Seed mode
2017-07-28 09:33:13 +00:00
2017-07-31 11:23:01 +00:00
This mode is best to use on dynamic size cluster
2017-07-27 15:00:54 +00:00
2017-07-31 11:23:01 +00:00
The seed mode also allows multi-clouds and hybrid on-premise/cloud clusters deployement.
2017-07-28 09:33:13 +00:00
2017-07-31 11:23:01 +00:00
* Switch from consensus mode to seed mode
2017-07-28 09:33:13 +00:00
2017-07-27 12:40:52 +00:00
```
# In file ./inventory/group_vars/k8s-cluster.yml
weave_mode_seed: true
```
2017-07-28 09:33:13 +00:00
2017-07-31 11:23:01 +00:00
These two variables are only used when `weave_mode_seed` is set to `true` (**/!\ do not manually change these values**)
2017-07-28 09:33:13 +00:00
2017-07-27 12:40:52 +00:00
```
# In file ./inventory/group_vars/k8s-cluster.yml
weave_seed: uninitialized
weave_peers: uninitialized
2017-07-27 15:00:54 +00:00
```
2017-07-31 11:23:01 +00:00
The first variable, `weave_seed`, saves the firsts nodes of the weave network
2017-07-28 09:33:13 +00:00
2017-07-31 11:23:01 +00:00
The seconde variable, `weave_peers`, saves IP of all nodes of the weave network
2017-07-27 15:00:54 +00:00
2017-07-31 11:23:01 +00:00
These two variables are used to connect a new node to the weave network. The new node needs to know the firsts nodes (seed) and the list of IPs of all nodes.
2017-07-27 15:00:54 +00:00
2017-07-31 11:23:01 +00:00
To reset these variables and reset the weave network set them to `uninitialized`