From 465ffa3c9ff6d290ba5d7ef6a1feef851b7c7e6e Mon Sep 17 00:00:00 2001 From: brainfair <1761812+brainfair@users.noreply.github.com> Date: Thu, 28 Oct 2021 18:58:27 +0300 Subject: [PATCH] Weave: add extra_args for weave-npc (#8140) * add weave_npc_extra_args in template * add defaults weave_npc_extra_args * add sample for weave_npc_extra_args --- inventory/sample/group_vars/k8s_cluster/k8s-net-weave.yml | 3 +++ roles/network_plugin/weave/defaults/main.yml | 3 +++ roles/network_plugin/weave/templates/weave-net.yml.j2 | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/inventory/sample/group_vars/k8s_cluster/k8s-net-weave.yml b/inventory/sample/group_vars/k8s_cluster/k8s-net-weave.yml index ed6c3c08e..269a77c93 100644 --- a/inventory/sample/group_vars/k8s_cluster/k8s-net-weave.yml +++ b/inventory/sample/group_vars/k8s_cluster/k8s-net-weave.yml @@ -59,3 +59,6 @@ # Extra variables that passing to launch.sh, useful for enabling seed mode, see # https://www.weave.works/docs/net/latest/tasks/ipam/ipam/ # weave_extra_args: ~ + +# Extra variables for weave_npc that passing to launch.sh, useful for change log level, ex --log-level=error +# weave_npc_extra_args: ~ diff --git a/roles/network_plugin/weave/defaults/main.yml b/roles/network_plugin/weave/defaults/main.yml index b1c79a6db..47469ae4c 100644 --- a/roles/network_plugin/weave/defaults/main.yml +++ b/roles/network_plugin/weave/defaults/main.yml @@ -59,3 +59,6 @@ weave_iptables_backend: ~ # Extra variables that passing to launch.sh, useful for enabling seed mode, see # https://www.weave.works/docs/net/latest/tasks/ipam/ipam/ weave_extra_args: ~ + +# Extra variables for weave_npc that passing to launch.sh, useful for change log level, ex --log-level=error +weave_npc_extra_args: ~ diff --git a/roles/network_plugin/weave/templates/weave-net.yml.j2 b/roles/network_plugin/weave/templates/weave-net.yml.j2 index d32cfe9cf..84c4fa0da 100644 --- a/roles/network_plugin/weave/templates/weave-net.yml.j2 +++ b/roles/network_plugin/weave/templates/weave-net.yml.j2 @@ -230,6 +230,10 @@ items: fieldRef: apiVersion: v1 fieldPath: spec.nodeName +{% if weave_npc_extra_args %} + - name: EXTRA_ARGS + value: "{{ weave_npc_extra_args }}" +{% endif %} image: {{ weave_npc_image_repo }}:{{ weave_npc_image_tag }} imagePullPolicy: {{ k8s_image_pull_policy }} resources: