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

Commit

Permalink
Merge pull request #294 from kinvolk/surajssd/add-seccomp-to-prom-op
Browse files Browse the repository at this point in the history
prometheus operator: Add seccomp annotations to PSP
  • Loading branch information
surajssd authored Apr 15, 2020
2 parents ac214cf + 37534f2 commit 6ebc13a
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 10 deletions.
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

0 comments on commit 6ebc13a

Please sign in to comment.