Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

prometheus operator: Add seccomp annotations to PSP #294

Merged
merged 1 commit into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ metadata:
namespace: {{ $.Release.Namespace }}
labels:
app: {{ template "prometheus-operator.name" . }}-alertmanager
{{- if .Values.global.rbac.pspAnnotations }}
annotations:
{{ toYaml .Values.global.rbac.pspAnnotations | indent 4 }}
{{- end }}
{{ include "prometheus-operator.labels" . | indent 4 }}
spec:
privileged: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ metadata:
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "prometheus-operator.name" . }}-admission
{{- if .Values.global.rbac.pspAnnotations }}
annotations:
{{ toYaml .Values.global.rbac.pspAnnotations | indent 4 }}
{{- end }}
{{ include "prometheus-operator.labels" . | indent 4 }}
spec:
privileged: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ metadata:
namespace: {{ $.Release.Namespace }}
labels:
app: {{ template "prometheus-operator.name" . }}-operator
{{- if .Values.global.rbac.pspAnnotations }}
annotations:
{{ toYaml .Values.global.rbac.pspAnnotations | indent 4 }}
{{- end }}
{{ include "prometheus-operator.labels" . | indent 4 }}
spec:
privileged: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ metadata:
namespace: {{ $.Release.Namespace }}
labels:
app: {{ template "prometheus-operator.name" . }}-prometheus
{{- if .Values.global.rbac.pspAnnotations }}
annotations:
{{ toYaml .Values.global.rbac.pspAnnotations | indent 4 }}
{{- end }}
{{ include "prometheus-operator.labels" . | indent 4 }}
spec:
privileged: false
Expand Down
9 changes: 9 additions & 0 deletions assets/components/prometheus-operator/manifests/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ global:
rbac:
create: true
pspEnabled: true
pspAnnotations: {}
## Specify pod annotations
## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor
## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp
## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl
##
# seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
# seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
# apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'

## Reference to one or more secrets to be used when pulling images
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
Expand Down
20 changes: 10 additions & 10 deletions pkg/assets/generated_assets.go

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions pkg/components/prometheus-operator/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
package prometheus

const chartValuesTmpl = `
global:
rbac:
pspAnnotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'

alertmanager:
{{.AlertManagerConfig}}
alertmanagerSpec:
Expand Down