diff --git a/prometheus-alertmanager/templates/statefulset.yaml b/prometheus-alertmanager/templates/statefulset.yaml index b12ecf89c..248f0a22c 100644 --- a/prometheus-alertmanager/templates/statefulset.yaml +++ b/prometheus-alertmanager/templates/statefulset.yaml @@ -47,8 +47,6 @@ spec: configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} {{ dict "envAll" $envAll "podName" "alertmanager" "containerNames" (list "alertmanager") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: - securityContext: - readOnlyRootFilesystem: true {{ dict "envAll" $envAll "application" "alertmanager" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} affinity: @@ -75,8 +73,7 @@ spec: - name: alertmanager {{ tuple $envAll "alertmanager" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.alertmanager | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - securityContext: - allowPrivilegeEscalation: false +{{ dict "envAll" $envAll "application" "alertmanager" "container" "alertmanager" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} command: - /tmp/alertmanager.sh - start diff --git a/prometheus-alertmanager/values.yaml b/prometheus-alertmanager/values.yaml index 8528f712f..bd866f1c1 100644 --- a/prometheus-alertmanager/values.yaml +++ b/prometheus-alertmanager/values.yaml @@ -42,9 +42,14 @@ pod: type: apparmor alertmanager: alertmanager: localhost/docker-default - user: + security_context: alertmanager: - uid: 65534 + pod: + runAsUser: 65534 + container: + alertmanager: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true affinity: anti: type: