diff --git a/inventory/group_vars/k8s-cluster.yml b/inventory/group_vars/k8s-cluster.yml index 7528288ad..8211011a3 100644 --- a/inventory/group_vars/k8s-cluster.yml +++ b/inventory/group_vars/k8s-cluster.yml @@ -76,7 +76,7 @@ kube_network_plugin: weave weave_password: ~t94S:mweJN}32-K # Set true for use weave's seed mode -mode_seed: false +weave_mode_seed: true # Enable kubernetes network policies enable_network_policy: false diff --git a/inventory/group_vars/k8s-fede.yml b/inventory/group_vars/k8s-fede.yml index 1ef9a2d76..397835678 100644 --- a/inventory/group_vars/k8s-fede.yml +++ b/inventory/group_vars/k8s-fede.yml @@ -3,5 +3,5 @@ # For reset values : # seed: unset # peers: unset -seed: unset -peers: unset +seed: fa:16:3e:b5:ea:aa,fa:16:3e:47:29:c6 +peers: 192.168.208.13 192.168.208.9 diff --git a/roles/network_plugin/weave/tasks/main.yml b/roles/network_plugin/weave/tasks/main.yml index 2a02a3c59..dbcd95716 100644 --- a/roles/network_plugin/weave/tasks/main.yml +++ b/roles/network_plugin/weave/tasks/main.yml @@ -2,7 +2,7 @@ - include: pre-upgrade.yml - include: seed.yml - when: mode_seed == true + when: weave_mode_seed == true - name: Weave | enable br_netfilter module modprobe: diff --git a/roles/network_plugin/weave/templates/weave-net.yml.j2 b/roles/network_plugin/weave/templates/weave-net.yml.j2 index eacf96661..c488b94b0 100644 --- a/roles/network_plugin/weave/templates/weave-net.yml.j2 +++ b/roles/network_plugin/weave/templates/weave-net.yml.j2 @@ -64,10 +64,12 @@ items: spec: containers: - name: weave -{% if mode_seed == true %} - command: ["/bin/sh","-c","export EXTRA_ARGS=--name=$(cat /sys/class/net/{{ ansible_default_ipv4['interface'] }}/address) && /home/weave/launch.sh"] + command: +{% if weave_mode_seed == true %} + - /bin/sh + - -c + - export EXTRA_ARGS=--name=$(cat /sys/class/net/ens3/address) && /home/weave/launch.sh {% else %} - command: - /home/weave/launch.sh {% endif %} env: @@ -78,7 +80,7 @@ items: fieldPath: spec.nodeName - name: IPALLOC_RANGE value: {{ kube_pods_subnet }} -{% if mode_seed == true %} +{% if weave_mode_seed == true %} - name: KUBE_PEERS value: {{ weave_peers }} - name: IPALLOC_INIT