Skip to content

Commit

Permalink
[prometheus-mongodb-exporter] Allow to configure pod security context
Browse files Browse the repository at this point in the history
Signed-off-by: Yves Galante <yves.galante@zelros.com>
  • Loading branch information
YvesZelros committed Dec 23, 2024
1 parent 619b91c commit a6f9a9c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-mongodb-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ maintainers:
name: prometheus-mongodb-exporter
sources:
- https://github.com/percona/mongodb_exporter
version: 3.10.0
version: 3.11.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Test customize podSecurityContext

mongodb:
uri: mongodb://localhost:9216

podSecurityContext:
seccompProfile:
type: RuntimeDefault
4 changes: 4 additions & 0 deletions charts/prometheus-mongodb-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ spec:
{{- end }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- tpl (toYaml .) $ | nindent 8 }}
Expand Down
9 changes: 8 additions & 1 deletion charts/prometheus-mongodb-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,17 @@ resources: {}
# cpu: 100m
# memory: 128Mi

# Customize securityContext of the pod.
# See https://kubernetes.io/docs/concepts/policy/security-context/ for more.
podSecurityContext: {}
# seccompProfile:
# type: RuntimeDefault

securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["all"]
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 10000
runAsNonRoot: true
Expand Down

0 comments on commit a6f9a9c

Please sign in to comment.