You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.1 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. Weave
  2. =======
  3. Weave 2.0.1 is supported by kubespray
  4. 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.
  5. `Consensus` mode is best to use on static size cluster and `seed` mode is best to use on dynamic size cluster
  6. Weave encryption is supported for all communication
  7. * To use Weave encryption, specify a strong password (if no password, no encrytion)
  8. ```
  9. # In file ./inventory/group_vars/k8s-cluster.yml
  10. weave_password: EnterPasswordHere
  11. ```
  12. This password is used to set an environment variable inside weave container.
  13. Weave is deployed by kubespray using a daemonSet
  14. * Check the status of Weave containers
  15. ```
  16. # From client
  17. kubectl -n kube-system get pods | grep weave
  18. # output
  19. weave-net-50wd2 2/2 Running 0 2m
  20. weave-net-js9rb 2/2 Running 0 2m
  21. ```
  22. There must be as many pods as nodes (here kubernetes have 2 nodes so there are 2 weave pods).
  23. * Check status of weave (connection,encryption ...) for each node
  24. ```
  25. # On nodes
  26. curl http://127.0.0.1:6784/status
  27. # output on node1
  28. Version: 2.0.1 (up to date; next check at 2017/08/01 13:51:34)
  29. Service: router
  30. Protocol: weave 1..2
  31. Name: fa:16:3e:b3:d6:b2(node1)
  32. Encryption: enabled
  33. PeerDiscovery: enabled
  34. Targets: 2
  35. Connections: 2 (1 established, 1 failed)
  36. Peers: 2 (with 2 established connections)
  37. TrustedSubnets: none
  38. Service: ipam
  39. Status: ready
  40. Range: 10.233.64.0/18
  41. DefaultSubnet: 10.233.64.0/18
  42. ```
  43. * Check parameters of weave for each node
  44. ```
  45. # On nodes
  46. ps -aux | grep weaver
  47. # output on node1 (here its use seed mode)
  48. 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
  49. ```
  50. ### Consensus mode (default mode)
  51. This mode is best to use on static size cluster
  52. ### Seed mode
  53. This mode is best to use on dynamic size cluster
  54. The seed mode also allows multi-clouds and hybrid on-premise/cloud clusters deployement.
  55. * Switch from consensus mode to seed mode
  56. ```
  57. # In file ./inventory/group_vars/k8s-cluster.yml
  58. weave_mode_seed: true
  59. ```
  60. These two variables are only used when `weave_mode_seed` is set to `true` (**/!\ do not manually change these values**)
  61. ```
  62. # In file ./inventory/group_vars/k8s-cluster.yml
  63. weave_seed: uninitialized
  64. weave_peers: uninitialized
  65. ```
  66. The first variable, `weave_seed`, contains the initial nodes of the weave network
  67. The seconde variable, `weave_peers`, saves the IPs of all nodes joined to the weave network
  68. 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.
  69. To reset these variables and reset the weave network set them to `uninitialized`