Skip to content

Commit

Permalink
manifests: fix PodSecurityContext for gateways (#24506)
Browse files Browse the repository at this point in the history
Relevant parameters had to be moved into container securityContext
  • Loading branch information
dgn authored Jun 8, 2020
1 parent 0df3734 commit c05e57f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
15 changes: 9 additions & 6 deletions manifests/charts/gateways/istio-egress/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ spec:
runAsGroup: 1337
runAsNonRoot: true
fsGroup: 1337
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
{{- end }}
serviceAccountName: {{ $gateway.name | default "istio-egressgateway" }}-service-account
{{- if .Values.global.priorityClassName }}
Expand Down Expand Up @@ -126,6 +120,15 @@ spec:
{{- end }}
{{- if .Values.global.trustDomain }}
- --trust-domain={{ .Values.global.trustDomain }}
{{- end }}
{{- if not $gateway.runAsRoot }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
{{- end }}
readinessProbe:
failureThreshold: 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ spec:
runAsGroup: 1337
runAsNonRoot: true
fsGroup: 1337
# Not supported in K8S 1.15 - use runAsRoot=true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
{{- end }}
serviceAccountName: {{ $gateway.name | default "istio-ingressgateway" }}-service-account
{{- if .Values.global.priorityClassName }}
Expand Down Expand Up @@ -130,6 +123,15 @@ spec:
{{- end }}
{{- if .Values.global.trustDomain }}
- --trust-domain={{ .Values.global.trustDomain }}
{{- end }}
{{- if not $gateway.runAsRoot }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
{{- end }}
readinessProbe:
failureThreshold: 30
Expand Down

0 comments on commit c05e57f

Please sign in to comment.