Skip to content
Snippets Groups Projects
weave.md 2.62 KiB
Newer Older
  • Learn to ignore specific revisions
  • Maxime Guyot's avatar
    Maxime Guyot committed
    # Weave
    
    email's avatar
    email committed
    
    Weave 2.0.1 is supported by kubespray
    
    
    timtoum's avatar
    timtoum committed
    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.
    
    email's avatar
    email committed
    
    
    email's avatar
    email committed
    `Consensus` mode is best to use on static size cluster and `seed` mode is best to use on dynamic size cluster
    
    
    email's avatar
    email committed
    Weave encryption is supported for all communication
    
    email's avatar
    email committed
    
    
    Rui Cao's avatar
    Rui Cao committed
    * To use Weave encryption, specify a strong password (if no password, no encryption)
    
    email's avatar
    email committed
    
    
    Maxime Guyot's avatar
    Maxime Guyot committed
    ```ShellSession
    
    # In file ./inventory/sample/group_vars/k8s_cluster.yml
    
    email's avatar
    email committed
    weave_password: EnterPasswordHere
    ```
    
    
    email's avatar
    email committed
    This password is used to set an environment variable inside weave container.
    
    email's avatar
    email committed
    
    
    email's avatar
    email committed
    Weave is deployed by kubespray using a daemonSet
    
    email's avatar
    email committed
    
    
    email's avatar
    email committed
    * Check the status of Weave containers
    
    email's avatar
    email committed
    
    
    Maxime Guyot's avatar
    Maxime Guyot committed
    ```ShellSession
    
    email's avatar
    email committed
    # From client
    
    email's avatar
    email committed
    kubectl -n kube-system get pods | grep weave
    
    email's avatar
    email committed
    # output
    weave-net-50wd2                       2/2       Running   0          2m
    weave-net-js9rb                       2/2       Running   0          2m
    
    email's avatar
    email committed
    ```
    
    email's avatar
    email committed
    There must be as many pods as nodes (here kubernetes have 2 nodes so there are 2 weave pods).
    
    email's avatar
    email committed
    
    
    email's avatar
    email committed
    * Check status of weave (connection,encryption ...) for each node
    
    email's avatar
    email committed
    
    
    Maxime Guyot's avatar
    Maxime Guyot committed
    ```ShellSession
    
    email's avatar
    email committed
    # On nodes
    
    email's avatar
    email committed
    curl http://127.0.0.1:6784/status
    
    email's avatar
    email committed
    # output on node1
    Version: 2.0.1 (up to date; next check at 2017/08/01 13:51:34)
    
            Service: router
           Protocol: weave 1..2
               Name: fa:16:3e:b3:d6:b2(node1)
         Encryption: enabled
      PeerDiscovery: enabled
            Targets: 2
        Connections: 2 (1 established, 1 failed)
              Peers: 2 (with 2 established connections)
     TrustedSubnets: none
    
            Service: ipam
             Status: ready
              Range: 10.233.64.0/18
      DefaultSubnet: 10.233.64.0/18
    
    email's avatar
    email committed
    ```
    
    
    email's avatar
    email committed
    * Check parameters of weave for each node
    
    email's avatar
    email committed
    
    
    Maxime Guyot's avatar
    Maxime Guyot committed
    ```ShellSession
    
    email's avatar
    email committed
    # On nodes
    
    email's avatar
    email committed
    ps -aux | grep weaver
    
    email's avatar
    email committed
    # output on node1 (here its use seed mode)
    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
    
    email's avatar
    email committed
    ```
    
    
    Maxime Guyot's avatar
    Maxime Guyot committed
    ## Consensus mode (default mode)
    
    email's avatar
    email committed
    
    
    email's avatar
    email committed
    This mode is best to use on static size cluster
    
    email's avatar
    email committed
    
    ### Seed mode
    
    email's avatar
    email committed
    
    
    email's avatar
    email committed
    This mode is best to use on dynamic size cluster
    
    email's avatar
    email committed
    
    
    The seed mode also allows multi-clouds and hybrid on-premise/cloud clusters deployment.
    
    email's avatar
    email committed
    
    
    * Switch from consensus mode to seed/Observation mode
    
    email's avatar
    email committed
    
    
    See [weave ipam documentation](https://www.weave.works/docs/net/latest/tasks/ipam/ipam/) and use `weave_extra_args` to enable.