Skip to content

Commit 27daa2c

Browse files
authored
Merge pull request #1803 from alex-souslik-hs/main
loadtester: add pod security context
2 parents 6f165a1 + ed38a79 commit 27daa2c

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

charts/loadtester/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ The following tables lists the configurable parameters of the load tester chart
6969
| `istio.tls.enabled` | Enable TLS in gateway ( TLS secrets should be in namespace ) | `false` |
7070
| `istio.tls.httpsRedirect` | Redirect traffic to TLS port | `false` |
7171
| `podPriorityClassName` | PriorityClass name for pod priority configuration | "" |
72-
| `securityContext.enabled` | Add securityContext to container | "" |
73-
| `securityContext.context` | securityContext to add | "" |
72+
| `securityContext.enabled` | Add securityContext to container | `false` |
73+
| `SecurityContext.context` | securityContext to add | "" |
74+
| `podSecurityContext.enabled` | Add securityContext to pod | `false` |
75+
| `podSecurityContext.context` | securityContext to add | "" |
7476
| `podDisruptionBudget.enabled` | A PodDisruptionBudget will be created if `true` | `false` |
7577
| `podDisruptionBudget.minAvailable` | The minimal number of available replicas that will be set in the PodDisruptionBudget | `1` |
7678

charts/loadtester/templates/deployment.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
appmesh.k8s.aws/ports: "444"
2525
openservicemesh.io/inbound-port-exclusion-list: "80, 8080"
2626
{{- if .Values.podAnnotations }}
27-
{{ toYaml .Values.podAnnotations | indent 8 }}
27+
{{- toYaml .Values.podAnnotations | nindent 8 }}
2828
{{- end }}
2929
spec:
3030
{{- if .Values.serviceAccountName }}
@@ -39,7 +39,7 @@ spec:
3939
- name: {{ .Chart.Name }}
4040
{{- if .Values.securityContext.enabled }}
4141
securityContext:
42-
{{ toYaml .Values.securityContext.context | indent 12 }}
42+
{{- toYaml .Values.securityContext.context | nindent 12 }}
4343
{{- end }}
4444
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
4545
imagePullPolicy: {{ .Values.image.pullPolicy }}
@@ -102,3 +102,7 @@ spec:
102102
tolerations:
103103
{{- toYaml . | nindent 8 }}
104104
{{- end }}
105+
{{- if .Values.podSecurityContext.enabled }}
106+
securityContext:
107+
{{- toYaml .Values.podSecurityContext.context | nindent 12 }}
108+
{{- end }}

charts/loadtester/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ securityContext:
9191
runAsUser: 100
9292
runAsGroup: 101
9393

94+
podSecurityContext:
95+
enabled: false
96+
context:
97+
fsGroup: 101
98+
fsGroupChangePolicy: "OnRootMismatch"
99+
94100
podDisruptionBudget:
95101
enabled: false
96102
minAvailable: 1

0 commit comments

Comments
 (0)