Skip to content

Commit 7900d43

Browse files
authored
Merge pull request #145 from steadybit/refa/helm-no-hardcoded-uid
refa: avoid hard-coded uid in helm chart
2 parents 051d50d + 8e3eb7f commit 7900d43

File tree

4 files changed

+51
-37
lines changed

4 files changed

+51
-37
lines changed

charts/steadybit-extension-prometheus/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: steadybit-extension-prometheus
33
description: Steadybit Prometheus extension Helm chart for Kubernetes.
4-
version: 1.5.9
4+
version: 1.5.10
55
appVersion: v2.1.2
66
home: https://www.steadybit.com/
77
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png

charts/steadybit-extension-prometheus/templates/deployment.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,10 @@ spec:
103103
httpGet:
104104
path: /health/readiness
105105
port: 8088
106+
{{- with .Values.containerSecurityContext }}
106107
securityContext:
107-
readOnlyRootFilesystem: true
108-
runAsNonRoot: true
109-
runAsUser: 10000
110-
runAsGroup: 10000
111-
allowPrivilegeEscalation: false
112-
capabilities:
113-
drop:
114-
- ALL
108+
{{- toYaml . | nindent 12 }}
109+
{{- end }}
115110
volumes:
116111
{{- include "extensionlib.deployment.volumes" (list .) | nindent 8 }}
117112
serviceAccountName: {{ .Values.serviceAccount.name }}

charts/steadybit-extension-prometheus/tests/__snapshot__/deployment_test.yaml.snap

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ manifest should match snapshot using podAnnotations and Labels:
7070
drop:
7171
- ALL
7272
readOnlyRootFilesystem: true
73-
runAsGroup: 10000
74-
runAsNonRoot: true
75-
runAsUser: 10000
7673
volumeMounts: null
74+
securityContext:
75+
runAsNonRoot: true
76+
seccompProfile:
77+
type: RuntimeDefault
7778
serviceAccountName: steadybit-extension-prometheus
7879
volumes: null
7980
manifest should match snapshot with TLS:
@@ -150,13 +151,14 @@ manifest should match snapshot with TLS:
150151
drop:
151152
- ALL
152153
readOnlyRootFilesystem: true
153-
runAsGroup: 10000
154-
runAsNonRoot: true
155-
runAsUser: 10000
156154
volumeMounts:
157155
- mountPath: /etc/extension/certificates/server-cert
158156
name: certificate-server-cert
159157
readOnly: true
158+
securityContext:
159+
runAsNonRoot: true
160+
seccompProfile:
161+
type: RuntimeDefault
160162
serviceAccountName: steadybit-extension-prometheus
161163
volumes:
162164
- name: certificate-server-cert
@@ -240,10 +242,11 @@ manifest should match snapshot with extra env vars:
240242
drop:
241243
- ALL
242244
readOnlyRootFilesystem: true
243-
runAsGroup: 10000
244-
runAsNonRoot: true
245-
runAsUser: 10000
246245
volumeMounts: null
246+
securityContext:
247+
runAsNonRoot: true
248+
seccompProfile:
249+
type: RuntimeDefault
247250
serviceAccountName: steadybit-extension-prometheus
248251
volumes: null
249252
manifest should match snapshot with extra labels:
@@ -318,10 +321,11 @@ manifest should match snapshot with extra labels:
318321
drop:
319322
- ALL
320323
readOnlyRootFilesystem: true
321-
runAsGroup: 10000
322-
runAsNonRoot: true
323-
runAsUser: 10000
324324
volumeMounts: null
325+
securityContext:
326+
runAsNonRoot: true
327+
seccompProfile:
328+
type: RuntimeDefault
325329
serviceAccountName: steadybit-extension-prometheus
326330
volumes: null
327331
manifest should match snapshot with mutual TLS:
@@ -400,16 +404,17 @@ manifest should match snapshot with mutual TLS:
400404
drop:
401405
- ALL
402406
readOnlyRootFilesystem: true
403-
runAsGroup: 10000
404-
runAsNonRoot: true
405-
runAsUser: 10000
406407
volumeMounts:
407408
- mountPath: /etc/extension/certificates/client-cert-a
408409
name: certificate-client-cert-a
409410
readOnly: true
410411
- mountPath: /etc/extension/certificates/server-cert
411412
name: certificate-server-cert
412413
readOnly: true
414+
securityContext:
415+
runAsNonRoot: true
416+
seccompProfile:
417+
type: RuntimeDefault
413418
serviceAccountName: steadybit-extension-prometheus
414419
volumes:
415420
- name: certificate-client-cert-a
@@ -496,10 +501,11 @@ manifest should match snapshot with mutual TLS using containerPaths:
496501
drop:
497502
- ALL
498503
readOnlyRootFilesystem: true
499-
runAsGroup: 10000
500-
runAsNonRoot: true
501-
runAsUser: 10000
502504
volumeMounts: null
505+
securityContext:
506+
runAsNonRoot: true
507+
seccompProfile:
508+
type: RuntimeDefault
503509
serviceAccountName: steadybit-extension-prometheus
504510
volumes: null
505511
manifest should match snapshot with podSecurityContext:
@@ -572,12 +578,12 @@ manifest should match snapshot with podSecurityContext:
572578
drop:
573579
- ALL
574580
readOnlyRootFilesystem: true
575-
runAsGroup: 10000
576-
runAsNonRoot: true
577-
runAsUser: 10000
578581
volumeMounts: null
579582
securityContext:
583+
runAsNonRoot: true
580584
runAsUser: 2222
585+
seccompProfile:
586+
type: RuntimeDefault
581587
serviceAccountName: steadybit-extension-prometheus
582588
volumes: null
583589
manifest should match snapshot with priority class:
@@ -650,11 +656,12 @@ manifest should match snapshot with priority class:
650656
drop:
651657
- ALL
652658
readOnlyRootFilesystem: true
653-
runAsGroup: 10000
654-
runAsNonRoot: true
655-
runAsUser: 10000
656659
volumeMounts: null
657660
priorityClassName: my-priority-class
661+
securityContext:
662+
runAsNonRoot: true
663+
seccompProfile:
664+
type: RuntimeDefault
658665
serviceAccountName: steadybit-extension-prometheus
659666
volumes: null
660667
manifest should match snapshot without TLS:
@@ -727,9 +734,10 @@ manifest should match snapshot without TLS:
727734
drop:
728735
- ALL
729736
readOnlyRootFilesystem: true
730-
runAsGroup: 10000
731-
runAsNonRoot: true
732-
runAsUser: 10000
733737
volumeMounts: null
738+
securityContext:
739+
runAsNonRoot: true
740+
seccompProfile:
741+
type: RuntimeDefault
734742
serviceAccountName: steadybit-extension-prometheus
735743
volumes: null

charts/steadybit-extension-prometheus/values.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,18 @@ affinity: {}
105105
priorityClassName: null
106106

107107
# podSecurityContext -- SecurityContext to apply to the pod.
108-
podSecurityContext: {}
108+
podSecurityContext:
109+
seccompProfile:
110+
type: RuntimeDefault
111+
runAsNonRoot: true
112+
113+
# containerSecurityContext -- SecurityContext to apply to the container.
114+
containerSecurityContext:
115+
readOnlyRootFilesystem: true
116+
allowPrivilegeEscalation: false
117+
capabilities:
118+
drop:
119+
- ALL
109120

110121
# extraEnv -- Array with extra environment variables to add to the container
111122
# e.g:

0 commit comments

Comments
 (0)