Skip to content

Commit ce1ab51

Browse files
authored
Merge pull request #333 from grafana/mplzik/nonroot-am-permissions
Configure securityContext for AlertManager statefulset.
2 parents 2bb1e34 + ffc9be9 commit ce1ab51

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

prometheus-ksonnet/lib/alertmanager.libsonnet

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@
150150
], self.alertmanager_pvc) +
151151
statefulset.mixin.spec.withServiceName('alertmanager') +
152152
statefulset.mixin.spec.template.metadata.withAnnotations({ 'prometheus.io.path': '%smetrics' % $._config.alertmanager_path }) +
153+
statefulset.mixin.spec.template.spec.securityContext.withFsGroup(2000) +
154+
statefulset.mixin.spec.template.spec.securityContext.withRunAsUser(1000) +
155+
statefulset.mixin.spec.template.spec.securityContext.withRunAsNonRoot(true) +
153156
$.util.configVolumeMount('alertmanager-config', '/etc/alertmanager/config') +
154157
$.util.podPriority('critical')
155158
else {},

0 commit comments

Comments
 (0)