Merge pull request #8265 from ReillyProcentive/WeaveNpcExtraArgs

Add support for weave.npcExtraArgs
This commit is contained in:
Kubernetes Prow Robot 2020-01-16 15:06:32 -08:00 committed by GitHub
commit a49ce910a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 66 additions and 20 deletions

View File

@ -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. 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 ### Configuring Weave network encryption
The Weave network encryption is configurable by creating a weave network secret password. The Weave network encryption is configurable by creating a weave network secret password.

View File

@ -2792,6 +2792,8 @@ spec:
format: int32 format: int32
type: integer type: integer
netExtraArgs: netExtraArgs:
description: NetExtraArgs are extra arguments that are passed
to weave-kube.
type: string type: string
noMasqLocal: noMasqLocal:
format: int32 format: int32
@ -2803,6 +2805,10 @@ spec:
description: NPCCPURequest CPU request of weave npc container. description: NPCCPURequest CPU request of weave npc container.
Default 50m Default 50m
type: string type: string
npcExtraArgs:
description: NPCExtraArgs are extra arguments that are passed
to weave-npc.
type: string
npcMemoryLimit: npcMemoryLimit:
description: NPCMemoryLimit memory limit of weave npc container. description: NPCMemoryLimit memory limit of weave npc container.
Default 200Mi Default 200Mi

View File

@ -63,10 +63,9 @@ type KopeioNetworkingSpec struct {
// WeaveNetworkingSpec declares that we want Weave networking // WeaveNetworkingSpec declares that we want Weave networking
type WeaveNetworkingSpec struct { type WeaveNetworkingSpec struct {
MTU *int32 `json:"mtu,omitempty"` MTU *int32 `json:"mtu,omitempty"`
ConnLimit *int32 `json:"connLimit,omitempty"` ConnLimit *int32 `json:"connLimit,omitempty"`
NoMasqLocal *int32 `json:"noMasqLocal,omitempty"` NoMasqLocal *int32 `json:"noMasqLocal,omitempty"`
NetExtraArgs string `json:"netExtraArgs,omitempty"`
// MemoryRequest memory request of weave container. Default 200Mi // MemoryRequest memory request of weave container. Default 200Mi
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"` MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
@ -76,6 +75,9 @@ type WeaveNetworkingSpec struct {
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"` MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
// CPULimit CPU limit of weave container. // CPULimit CPU limit of weave container.
CPULimit *resource.Quantity `json:"cpuLimit,omitempty"` CPULimit *resource.Quantity `json:"cpuLimit,omitempty"`
// NetExtraArgs are extra arguments that are passed to weave-kube.
NetExtraArgs string `json:"netExtraArgs,omitempty"`
// NPCMemoryRequest memory request of weave npc container. Default 200Mi // NPCMemoryRequest memory request of weave npc container. Default 200Mi
NPCMemoryRequest *resource.Quantity `json:"npcMemoryRequest,omitempty"` NPCMemoryRequest *resource.Quantity `json:"npcMemoryRequest,omitempty"`
// NPCCPURequest CPU request of weave npc container. Default 50m // NPCCPURequest CPU request of weave npc container. Default 50m
@ -84,6 +86,8 @@ type WeaveNetworkingSpec struct {
NPCMemoryLimit *resource.Quantity `json:"npcMemoryLimit,omitempty"` NPCMemoryLimit *resource.Quantity `json:"npcMemoryLimit,omitempty"`
// NPCCPULimit CPU limit of weave npc container // NPCCPULimit CPU limit of weave npc container
NPCCPULimit *resource.Quantity `json:"npcCPULimit,omitempty"` NPCCPULimit *resource.Quantity `json:"npcCPULimit,omitempty"`
// NPCExtraArgs are extra arguments that are passed to weave-npc.
NPCExtraArgs string `json:"npcExtraArgs,omitempty"`
} }
// FlannelNetworkingSpec declares that we want Flannel networking // FlannelNetworkingSpec declares that we want Flannel networking

View File

@ -63,10 +63,9 @@ type KopeioNetworkingSpec struct {
// WeaveNetworkingSpec declares that we want Weave networking // WeaveNetworkingSpec declares that we want Weave networking
type WeaveNetworkingSpec struct { type WeaveNetworkingSpec struct {
MTU *int32 `json:"mtu,omitempty"` MTU *int32 `json:"mtu,omitempty"`
ConnLimit *int32 `json:"connLimit,omitempty"` ConnLimit *int32 `json:"connLimit,omitempty"`
NoMasqLocal *int32 `json:"noMasqLocal,omitempty"` NoMasqLocal *int32 `json:"noMasqLocal,omitempty"`
NetExtraArgs string `json:"netExtraArgs,omitempty"`
// MemoryRequest memory request of weave container. Default 200Mi // MemoryRequest memory request of weave container. Default 200Mi
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"` MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
@ -76,6 +75,9 @@ type WeaveNetworkingSpec struct {
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"` MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
// CPULimit CPU limit of weave container. // CPULimit CPU limit of weave container.
CPULimit *resource.Quantity `json:"cpuLimit,omitempty"` CPULimit *resource.Quantity `json:"cpuLimit,omitempty"`
// NetExtraArgs are extra arguments that are passed to weave-kube.
NetExtraArgs string `json:"netExtraArgs,omitempty"`
// NPCMemoryRequest memory request of weave npc container. Default 200Mi // NPCMemoryRequest memory request of weave npc container. Default 200Mi
NPCMemoryRequest *resource.Quantity `json:"npcMemoryRequest,omitempty"` NPCMemoryRequest *resource.Quantity `json:"npcMemoryRequest,omitempty"`
// NPCCPURequest CPU request of weave npc container. Default 50m // NPCCPURequest CPU request of weave npc container. Default 50m
@ -84,6 +86,8 @@ type WeaveNetworkingSpec struct {
NPCMemoryLimit *resource.Quantity `json:"npcMemoryLimit,omitempty"` NPCMemoryLimit *resource.Quantity `json:"npcMemoryLimit,omitempty"`
// NPCCPULimit CPU limit of weave npc container // NPCCPULimit CPU limit of weave npc container
NPCCPULimit *resource.Quantity `json:"npcCPULimit,omitempty"` NPCCPULimit *resource.Quantity `json:"npcCPULimit,omitempty"`
// NPCExtraArgs are extra arguments that are passed to weave-npc.
NPCExtraArgs string `json:"npcExtraArgs,omitempty"`
} }
// FlannelNetworkingSpec declares that we want Flannel networking // FlannelNetworkingSpec declares that we want Flannel networking

View File

@ -4854,15 +4854,16 @@ func autoConvert_v1alpha1_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec(in *We
out.MTU = in.MTU out.MTU = in.MTU
out.ConnLimit = in.ConnLimit out.ConnLimit = in.ConnLimit
out.NoMasqLocal = in.NoMasqLocal out.NoMasqLocal = in.NoMasqLocal
out.NetExtraArgs = in.NetExtraArgs
out.MemoryRequest = in.MemoryRequest out.MemoryRequest = in.MemoryRequest
out.CPURequest = in.CPURequest out.CPURequest = in.CPURequest
out.MemoryLimit = in.MemoryLimit out.MemoryLimit = in.MemoryLimit
out.CPULimit = in.CPULimit out.CPULimit = in.CPULimit
out.NetExtraArgs = in.NetExtraArgs
out.NPCMemoryRequest = in.NPCMemoryRequest out.NPCMemoryRequest = in.NPCMemoryRequest
out.NPCCPURequest = in.NPCCPURequest out.NPCCPURequest = in.NPCCPURequest
out.NPCMemoryLimit = in.NPCMemoryLimit out.NPCMemoryLimit = in.NPCMemoryLimit
out.NPCCPULimit = in.NPCCPULimit out.NPCCPULimit = in.NPCCPULimit
out.NPCExtraArgs = in.NPCExtraArgs
return nil return nil
} }
@ -4875,15 +4876,16 @@ func autoConvert_kops_WeaveNetworkingSpec_To_v1alpha1_WeaveNetworkingSpec(in *ko
out.MTU = in.MTU out.MTU = in.MTU
out.ConnLimit = in.ConnLimit out.ConnLimit = in.ConnLimit
out.NoMasqLocal = in.NoMasqLocal out.NoMasqLocal = in.NoMasqLocal
out.NetExtraArgs = in.NetExtraArgs
out.MemoryRequest = in.MemoryRequest out.MemoryRequest = in.MemoryRequest
out.CPURequest = in.CPURequest out.CPURequest = in.CPURequest
out.MemoryLimit = in.MemoryLimit out.MemoryLimit = in.MemoryLimit
out.CPULimit = in.CPULimit out.CPULimit = in.CPULimit
out.NetExtraArgs = in.NetExtraArgs
out.NPCMemoryRequest = in.NPCMemoryRequest out.NPCMemoryRequest = in.NPCMemoryRequest
out.NPCCPURequest = in.NPCCPURequest out.NPCCPURequest = in.NPCCPURequest
out.NPCMemoryLimit = in.NPCMemoryLimit out.NPCMemoryLimit = in.NPCMemoryLimit
out.NPCCPULimit = in.NPCCPULimit out.NPCCPULimit = in.NPCCPULimit
out.NPCExtraArgs = in.NPCExtraArgs
return nil return nil
} }

View File

@ -63,10 +63,9 @@ type KopeioNetworkingSpec struct {
// WeaveNetworkingSpec declares that we want Weave networking // WeaveNetworkingSpec declares that we want Weave networking
type WeaveNetworkingSpec struct { type WeaveNetworkingSpec struct {
MTU *int32 `json:"mtu,omitempty"` MTU *int32 `json:"mtu,omitempty"`
ConnLimit *int32 `json:"connLimit,omitempty"` ConnLimit *int32 `json:"connLimit,omitempty"`
NoMasqLocal *int32 `json:"noMasqLocal,omitempty"` NoMasqLocal *int32 `json:"noMasqLocal,omitempty"`
NetExtraArgs string `json:"netExtraArgs,omitempty"`
// MemoryRequest memory request of weave container. Default 200Mi // MemoryRequest memory request of weave container. Default 200Mi
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"` MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
@ -76,6 +75,9 @@ type WeaveNetworkingSpec struct {
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"` MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
// CPULimit CPU limit of weave container. // CPULimit CPU limit of weave container.
CPULimit *resource.Quantity `json:"cpuLimit,omitempty"` CPULimit *resource.Quantity `json:"cpuLimit,omitempty"`
// NetExtraArgs are extra arguments that are passed to weave-kube.
NetExtraArgs string `json:"netExtraArgs,omitempty"`
// NPCMemoryRequest memory request of weave npc container. Default 200Mi // NPCMemoryRequest memory request of weave npc container. Default 200Mi
NPCMemoryRequest *resource.Quantity `json:"npcMemoryRequest,omitempty"` NPCMemoryRequest *resource.Quantity `json:"npcMemoryRequest,omitempty"`
// NPCCPURequest CPU request of weave npc container. Default 50m // NPCCPURequest CPU request of weave npc container. Default 50m
@ -84,6 +86,8 @@ type WeaveNetworkingSpec struct {
NPCMemoryLimit *resource.Quantity `json:"npcMemoryLimit,omitempty"` NPCMemoryLimit *resource.Quantity `json:"npcMemoryLimit,omitempty"`
// NPCCPULimit CPU limit of weave npc container // NPCCPULimit CPU limit of weave npc container
NPCCPULimit *resource.Quantity `json:"npcCPULimit,omitempty"` NPCCPULimit *resource.Quantity `json:"npcCPULimit,omitempty"`
// NPCExtraArgs are extra arguments that are passed to weave-npc.
NPCExtraArgs string `json:"npcExtraArgs,omitempty"`
} }
// FlannelNetworkingSpec declares that we want Flannel networking // FlannelNetworkingSpec declares that we want Flannel networking

View File

@ -5182,15 +5182,16 @@ func autoConvert_v1alpha2_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec(in *We
out.MTU = in.MTU out.MTU = in.MTU
out.ConnLimit = in.ConnLimit out.ConnLimit = in.ConnLimit
out.NoMasqLocal = in.NoMasqLocal out.NoMasqLocal = in.NoMasqLocal
out.NetExtraArgs = in.NetExtraArgs
out.MemoryRequest = in.MemoryRequest out.MemoryRequest = in.MemoryRequest
out.CPURequest = in.CPURequest out.CPURequest = in.CPURequest
out.MemoryLimit = in.MemoryLimit out.MemoryLimit = in.MemoryLimit
out.CPULimit = in.CPULimit out.CPULimit = in.CPULimit
out.NetExtraArgs = in.NetExtraArgs
out.NPCMemoryRequest = in.NPCMemoryRequest out.NPCMemoryRequest = in.NPCMemoryRequest
out.NPCCPURequest = in.NPCCPURequest out.NPCCPURequest = in.NPCCPURequest
out.NPCMemoryLimit = in.NPCMemoryLimit out.NPCMemoryLimit = in.NPCMemoryLimit
out.NPCCPULimit = in.NPCCPULimit out.NPCCPULimit = in.NPCCPULimit
out.NPCExtraArgs = in.NPCExtraArgs
return nil return nil
} }
@ -5203,15 +5204,16 @@ func autoConvert_kops_WeaveNetworkingSpec_To_v1alpha2_WeaveNetworkingSpec(in *ko
out.MTU = in.MTU out.MTU = in.MTU
out.ConnLimit = in.ConnLimit out.ConnLimit = in.ConnLimit
out.NoMasqLocal = in.NoMasqLocal out.NoMasqLocal = in.NoMasqLocal
out.NetExtraArgs = in.NetExtraArgs
out.MemoryRequest = in.MemoryRequest out.MemoryRequest = in.MemoryRequest
out.CPURequest = in.CPURequest out.CPURequest = in.CPURequest
out.MemoryLimit = in.MemoryLimit out.MemoryLimit = in.MemoryLimit
out.CPULimit = in.CPULimit out.CPULimit = in.CPULimit
out.NetExtraArgs = in.NetExtraArgs
out.NPCMemoryRequest = in.NPCMemoryRequest out.NPCMemoryRequest = in.NPCMemoryRequest
out.NPCCPURequest = in.NPCCPURequest out.NPCCPURequest = in.NPCCPURequest
out.NPCMemoryLimit = in.NPCMemoryLimit out.NPCMemoryLimit = in.NPCMemoryLimit
out.NPCCPULimit = in.NPCCPULimit out.NPCCPULimit = in.NPCCPULimit
out.NPCExtraArgs = in.NPCExtraArgs
return nil return nil
} }

View File

@ -211,6 +211,10 @@ spec:
fieldRef: fieldRef:
apiVersion: v1 apiVersion: v1
fieldPath: spec.nodeName fieldPath: spec.nodeName
{{- if .Networking.Weave.NPCExtraArgs }}
- name: EXTRA_ARGS
value: "{{ .Networking.Weave.NPCExtraArgs }}"
{{- end }}
image: 'weaveworks/weave-npc:2.6.0' image: 'weaveworks/weave-npc:2.6.0'
ports: ports:
- name: metrics - name: metrics

View File

@ -207,6 +207,10 @@ spec:
fieldRef: fieldRef:
apiVersion: v1 apiVersion: v1
fieldPath: spec.nodeName fieldPath: spec.nodeName
{{- if .Networking.Weave.NPCExtraArgs }}
- name: EXTRA_ARGS
value: "{{ .Networking.Weave.NPCExtraArgs }}"
{{- end }}
image: 'weaveworks/weave-npc:2.6.0' image: 'weaveworks/weave-npc:2.6.0'
ports: ports:
- name: metrics - name: metrics

View File

@ -28,10 +28,12 @@ spec:
cpuRequest: 100m cpuRequest: 100m
memoryLimit: 300Mi memoryLimit: 300Mi
cpuLimit: 200m cpuLimit: 200m
netExtraArgs: --log-level=info
npcMemoryRequest: 300Mi npcMemoryRequest: 300Mi
npcCPURequest: 100m npcCPURequest: 100m
npcMemoryLimit: 300Mi npcMemoryLimit: 300Mi
npcCPULimit: 200m npcCPULimit: 200m
npcExtraArgs: --log-level=info
nonMasqueradeCIDR: 100.64.0.0/10 nonMasqueradeCIDR: 100.64.0.0/10
sshAccess: sshAccess:
- 0.0.0.0/0 - 0.0.0.0/0

View File

@ -123,7 +123,7 @@ spec:
- id: k8s-1.6 - id: k8s-1.6
kubernetesVersion: '>=1.6.0 <1.7.0' kubernetesVersion: '>=1.6.0 <1.7.0'
manifest: networking.weave/k8s-1.6.yaml manifest: networking.weave/k8s-1.6.yaml
manifestHash: 6dcb06c0178143b534dac093fcad00c331b12319 manifestHash: 3f021695840729640da3910d8da357e905d3450c
name: networking.weave name: networking.weave
selector: selector:
role.kubernetes.io/networking: "1" role.kubernetes.io/networking: "1"
@ -131,7 +131,7 @@ spec:
- id: k8s-1.7 - id: k8s-1.7
kubernetesVersion: '>=1.7.0 <1.8.0' kubernetesVersion: '>=1.7.0 <1.8.0'
manifest: networking.weave/k8s-1.7.yaml manifest: networking.weave/k8s-1.7.yaml
manifestHash: 29f0b9379ffda0cc4288c9769371dc5adc75687a manifestHash: 990772f9809ffb0cff4ea9341a9ab7e9094d7587
name: networking.weave name: networking.weave
selector: selector:
role.kubernetes.io/networking: "1" role.kubernetes.io/networking: "1"
@ -139,7 +139,7 @@ spec:
- id: k8s-1.8 - id: k8s-1.8
kubernetesVersion: '>=1.8.0 <1.12.0' kubernetesVersion: '>=1.8.0 <1.12.0'
manifest: networking.weave/k8s-1.8.yaml manifest: networking.weave/k8s-1.8.yaml
manifestHash: 75cc6479f36f443600f567e492707efcbb9fbd31 manifestHash: 50a20409003956b7c31a479408ca42ec97774854
name: networking.weave name: networking.weave
selector: selector:
role.kubernetes.io/networking: "1" role.kubernetes.io/networking: "1"
@ -147,7 +147,7 @@ spec:
- id: k8s-1.12 - id: k8s-1.12
kubernetesVersion: '>=1.12.0' kubernetesVersion: '>=1.12.0'
manifest: networking.weave/k8s-1.12.yaml manifest: networking.weave/k8s-1.12.yaml
manifestHash: eb939be2701cdd0c78468358513d74f9eb2d9308 manifestHash: d2df87d90f8877a201f5cad93de296697191d4ae
name: networking.weave name: networking.weave
selector: selector:
role.kubernetes.io/networking: "1" role.kubernetes.io/networking: "1"