diff --git a/docs/networking.md b/docs/networking.md index c9a98d5012..e5403ca4ff 100644 --- a/docs/networking.md +++ b/docs/networking.md @@ -125,6 +125,20 @@ spec: Note that it is possible to break the cluster networking if flags are improperly used and as such this option should be used with caution. +### Configuring Weave NPC EXTRA_ARGS + +Weave-npc (the Weave network policy controller) allows you to customize arguments of the running binary by setting the EXTRA_ARGS environmental variable. +This can be used for debugging or for customizing the logging level of weave npc. + +``` +spec: + networking: + weave: + npcExtraArgs: "--log-level=info" +``` + +Note that it is possible to break the cluster networking if flags are improperly used and as such this option should be used with caution. + ### Configuring Weave network encryption The Weave network encryption is configurable by creating a weave network secret password. diff --git a/k8s/crds/kops.k8s.io_clusters.yaml b/k8s/crds/kops.k8s.io_clusters.yaml index b424b598a1..268b49159f 100644 --- a/k8s/crds/kops.k8s.io_clusters.yaml +++ b/k8s/crds/kops.k8s.io_clusters.yaml @@ -2788,6 +2788,7 @@ spec: format: int32 type: integer netExtraArgs: + description: Extra arguments that are passed to weave-kube type: string noMasqLocal: format: int32 @@ -2799,6 +2800,9 @@ spec: description: NPCCPURequest CPU request of weave npc container. Default 50m type: string + npcExtraArgs: + description: Extra arguments that are passed to weave-npc + type: string npcMemoryLimit: description: NPCMemoryLimit memory limit of weave npc container. Default 200Mi diff --git a/pkg/apis/kops/networking.go b/pkg/apis/kops/networking.go index cbcb0be2c9..0275fd0f5e 100644 --- a/pkg/apis/kops/networking.go +++ b/pkg/apis/kops/networking.go @@ -67,6 +67,7 @@ type WeaveNetworkingSpec struct { ConnLimit *int32 `json:"connLimit,omitempty"` NoMasqLocal *int32 `json:"noMasqLocal,omitempty"` NetExtraArgs string `json:"netExtraArgs,omitempty"` + NpcExtraArgs string `json:"npcExtraArgs,omitempty"` // MemoryRequest memory request of weave container. Default 200Mi MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"` diff --git a/pkg/apis/kops/v1alpha1/networking.go b/pkg/apis/kops/v1alpha1/networking.go index 2ba5d5ee8b..659c0ec7c6 100644 --- a/pkg/apis/kops/v1alpha1/networking.go +++ b/pkg/apis/kops/v1alpha1/networking.go @@ -67,6 +67,7 @@ type WeaveNetworkingSpec struct { ConnLimit *int32 `json:"connLimit,omitempty"` NoMasqLocal *int32 `json:"noMasqLocal,omitempty"` NetExtraArgs string `json:"netExtraArgs,omitempty"` + NpcExtraArgs string `json:"npcExtraArgs,omitempty"` // MemoryRequest memory request of weave container. Default 200Mi MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"` diff --git a/pkg/apis/kops/v1alpha1/zz_generated.conversion.go b/pkg/apis/kops/v1alpha1/zz_generated.conversion.go index 46c0b4dd3e..556bbac2bc 100644 --- a/pkg/apis/kops/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha1/zz_generated.conversion.go @@ -4853,6 +4853,7 @@ func autoConvert_v1alpha1_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec(in *We out.ConnLimit = in.ConnLimit out.NoMasqLocal = in.NoMasqLocal out.NetExtraArgs = in.NetExtraArgs + out.NpcExtraArgs = in.NpcExtraArgs out.MemoryRequest = in.MemoryRequest out.CPURequest = in.CPURequest out.MemoryLimit = in.MemoryLimit @@ -4874,6 +4875,7 @@ func autoConvert_kops_WeaveNetworkingSpec_To_v1alpha1_WeaveNetworkingSpec(in *ko out.ConnLimit = in.ConnLimit out.NoMasqLocal = in.NoMasqLocal out.NetExtraArgs = in.NetExtraArgs + out.NpcExtraArgs = in.NpcExtraArgs out.MemoryRequest = in.MemoryRequest out.CPURequest = in.CPURequest out.MemoryLimit = in.MemoryLimit diff --git a/pkg/apis/kops/v1alpha2/networking.go b/pkg/apis/kops/v1alpha2/networking.go index e607676a01..d7e300f3d4 100644 --- a/pkg/apis/kops/v1alpha2/networking.go +++ b/pkg/apis/kops/v1alpha2/networking.go @@ -67,6 +67,7 @@ type WeaveNetworkingSpec struct { ConnLimit *int32 `json:"connLimit,omitempty"` NoMasqLocal *int32 `json:"noMasqLocal,omitempty"` NetExtraArgs string `json:"netExtraArgs,omitempty"` + NpcExtraArgs string `json:"npcExtraArgs,omitempty"` // MemoryRequest memory request of weave container. Default 200Mi MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"` diff --git a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go index 06041c4bb1..f6f3ca575a 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go @@ -5181,6 +5181,7 @@ func autoConvert_v1alpha2_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec(in *We out.ConnLimit = in.ConnLimit out.NoMasqLocal = in.NoMasqLocal out.NetExtraArgs = in.NetExtraArgs + out.NpcExtraArgs = in.NpcExtraArgs out.MemoryRequest = in.MemoryRequest out.CPURequest = in.CPURequest out.MemoryLimit = in.MemoryLimit @@ -5202,6 +5203,7 @@ func autoConvert_kops_WeaveNetworkingSpec_To_v1alpha2_WeaveNetworkingSpec(in *ko out.ConnLimit = in.ConnLimit out.NoMasqLocal = in.NoMasqLocal out.NetExtraArgs = in.NetExtraArgs + out.NpcExtraArgs = in.NpcExtraArgs out.MemoryRequest = in.MemoryRequest out.CPURequest = in.CPURequest out.MemoryLimit = in.MemoryLimit diff --git a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.12.yaml.template b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.12.yaml.template index e00ef788c5..3b4b0b3db8 100644 --- a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.12.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.12.yaml.template @@ -211,6 +211,10 @@ spec: fieldRef: apiVersion: v1 fieldPath: spec.nodeName + {{- if .Networking.Weave.NpcExtraArgs }} + - name: EXTRA_ARGS + value: "{{ .Networking.Weave.NpcExtraArgs }}" + {{- end }} image: 'weaveworks/weave-npc:2.6.0' ports: - name: metrics diff --git a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.7.yaml.template b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.7.yaml.template index b55341ffa4..152fd0c67c 100644 --- a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.7.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.7.yaml.template @@ -203,6 +203,10 @@ spec: fieldRef: apiVersion: v1 fieldPath: spec.nodeName + {{- if .Networking.Weave.NpcExtraArgs }} + - name: EXTRA_ARGS + value: "{{ .Networking.Weave.NpcExtraArgs }}" + {{- end }} image: 'weaveworks/weave-npc:2.6.0' ports: - name: metrics diff --git a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.8.yaml.template b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.8.yaml.template index cd83d8d026..d5113340a7 100644 --- a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.8.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.8.yaml.template @@ -207,6 +207,10 @@ spec: fieldRef: apiVersion: v1 fieldPath: spec.nodeName + {{- if .Networking.Weave.NpcExtraArgs }} + - name: EXTRA_ARGS + value: "{{ .Networking.Weave.NpcExtraArgs }}" + {{- end }} image: 'weaveworks/weave-npc:2.6.0' ports: - name: metrics