Merge "Postgresql-exporter: Add security context for pod/container"

This commit is contained in:
Zuul 2019-04-21 10:48:05 +00:00 committed by Gerrit Code Review
commit 4e3359a931
2 changed files with 10 additions and 0 deletions

View File

@ -35,6 +35,7 @@ spec:
{{ tuple $envAll "prometheus_postgresql_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
namespace: {{ .Values.endpoints.prometheus_postgresql_exporter.namespace }}
spec:
{{ dict "envAll" $envAll "application" "prometheus_postgresql_exporter" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
serviceAccountName: {{ $serviceAccountName }}
nodeSelector:
{{ .Values.labels.prometheus_postgresql_exporter.node_selector_key }}: {{ .Values.labels.prometheus_postgresql_exporter.node_selector_value }}
@ -45,6 +46,7 @@ spec:
- name: postgresql-exporter
{{ tuple $envAll "prometheus_postgresql_exporter" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.prometheus_postgresql_exporter | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "prometheus_postgresql_exporter" "container" "postgresql_exporter" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
ports:
- name: metrics
containerPort: {{ tuple "prometheus_postgresql_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}

View File

@ -20,10 +20,18 @@ release_group: null
pod:
security_context:
prometheus_postgresql_exporter:
pod:
runAsUser: 65534
container:
postgresql_exporter:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
server:
container:
set-volume-perms:
runAsUser: 0
readOnlyRootFilesystem: true
pod:
allowPrivilegeEscalation: false
runAsUser: 999