Skip to content

Commit dd3fe7b

Browse files
authored
feat: allow to custom pod securityContext in gateway-helm (#9036)
* feat: allow to custom pod securityContext in gateway-helm Signed-off-by: zirain <zirain2009@gmail.com> * add default value Signed-off-by: zirain <zirain2009@gmail.com> --------- Signed-off-by: zirain <zirain2009@gmail.com>
1 parent d31e1fb commit dd3fe7b

35 files changed

Lines changed: 948 additions & 0 deletions

charts/gateway-helm/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ helm uninstall eg -n envoy-gateway-system
111111
| deployment.pod.extraVolumes | list | `[]` | |
112112
| deployment.pod.labels | object | `{}` | |
113113
| deployment.pod.nodeSelector | object | `{}` | |
114+
| deployment.pod.securityContext.runAsGroup | int | `65532` | |
115+
| deployment.pod.securityContext.runAsNonRoot | bool | `true` | |
116+
| deployment.pod.securityContext.runAsUser | int | `65532` | |
117+
| deployment.pod.securityContext.seccompProfile.type | string | `"RuntimeDefault"` | |
114118
| deployment.pod.tolerations | list | `[]` | |
115119
| deployment.pod.topologySpreadConstraints | list | `[]` | |
116120
| deployment.ports[0].name | string | `"grpc"` | |

charts/gateway-helm/templates/envoy-gateway-deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ spec:
4848
tolerations:
4949
{{- toYaml . | nindent 6 }}
5050
{{- end }}
51+
{{- with .Values.deployment.pod.securityContext }}
52+
securityContext:
53+
{{- toYaml . | nindent 8 }}
54+
{{- end }}
5155
containers:
5256
- args:
5357
- server

charts/gateway-helm/values.tmpl.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ deployment:
104104
# - name: foo
105105
# configMap:
106106
# name: myconfigmap
107+
securityContext:
108+
runAsNonRoot: true
109+
runAsGroup: 65532
110+
runAsUser: 65532
111+
seccompProfile:
112+
type: RuntimeDefault
107113

108114
service:
109115
# If set to PreferClose, the Envoy fleet will prioritize connecting to the Envoy Gateway pods that are topologically closest to them.

site/content/en/latest/install/gateway-helm-api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ The Helm chart for Envoy Gateway
5656
| deployment.pod.extraVolumes | list | `[]` | |
5757
| deployment.pod.labels | object | `{}` | |
5858
| deployment.pod.nodeSelector | object | `{}` | |
59+
| deployment.pod.securityContext.runAsGroup | int | `65532` | |
60+
| deployment.pod.securityContext.runAsNonRoot | bool | `true` | |
61+
| deployment.pod.securityContext.runAsUser | int | `65532` | |
62+
| deployment.pod.securityContext.seccompProfile.type | string | `"RuntimeDefault"` | |
5963
| deployment.pod.tolerations | list | `[]` | |
6064
| deployment.pod.topologySpreadConstraints | list | `[]` | |
6165
| deployment.ports[0].name | string | `"grpc"` | |

test/helm/gateway-helm/certgen-annotations.out.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ spec:
441441
app.kubernetes.io/instance: gateway-helm
442442
spec:
443443
automountServiceAccountToken: true
444+
securityContext:
445+
runAsGroup: 65532
446+
runAsNonRoot: true
447+
runAsUser: 65532
448+
seccompProfile:
449+
type: RuntimeDefault
444450
containers:
445451
- args:
446452
- server

test/helm/gateway-helm/certgen-args.out.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ spec:
441441
app.kubernetes.io/instance: gateway-helm
442442
spec:
443443
automountServiceAccountToken: true
444+
securityContext:
445+
runAsGroup: 65532
446+
runAsNonRoot: true
447+
runAsUser: 65532
448+
seccompProfile:
449+
type: RuntimeDefault
444450
containers:
445451
- args:
446452
- server

test/helm/gateway-helm/certgen-labels.out.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ spec:
441441
app.kubernetes.io/instance: gateway-helm
442442
spec:
443443
automountServiceAccountToken: true
444+
securityContext:
445+
runAsGroup: 65532
446+
runAsNonRoot: true
447+
runAsUser: 65532
448+
seccompProfile:
449+
type: RuntimeDefault
444450
containers:
445451
- args:
446452
- server

test/helm/gateway-helm/certjen-custom-scheduling.out.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ spec:
441441
app.kubernetes.io/instance: gateway-helm
442442
spec:
443443
automountServiceAccountToken: true
444+
securityContext:
445+
runAsGroup: 65532
446+
runAsNonRoot: true
447+
runAsUser: 65532
448+
seccompProfile:
449+
type: RuntimeDefault
444450
containers:
445451
- args:
446452
- server

test/helm/gateway-helm/common-labels.out.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,12 @@ spec:
481481
app.kubernetes.io/instance: gateway-helm
482482
spec:
483483
automountServiceAccountToken: true
484+
securityContext:
485+
runAsGroup: 65532
486+
runAsNonRoot: true
487+
runAsUser: 65532
488+
seccompProfile:
489+
type: RuntimeDefault
484490
containers:
485491
- args:
486492
- server

test/helm/gateway-helm/control-plane-with-pdb.out.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,12 @@ spec:
456456
app.kubernetes.io/instance: gateway-helm
457457
spec:
458458
automountServiceAccountToken: true
459+
securityContext:
460+
runAsGroup: 65532
461+
runAsNonRoot: true
462+
runAsUser: 65532
463+
seccompProfile:
464+
type: RuntimeDefault
459465
containers:
460466
- args:
461467
- server

0 commit comments

Comments
 (0)