Skip to content

Commit

Permalink
feat: Add pod annotations specific for openshift environment (open-po…
Browse files Browse the repository at this point in the history
…licy-agent#2116)

Signed-off-by: davis-haba <davishaba@google.com>
  • Loading branch information
erezo9 authored and davis-haba committed Jul 19, 2022
1 parent da9af9a commit 0686ec8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
16 changes: 13 additions & 3 deletions cmd/build/helmify/replacements.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ var replacements = map[string]string{

`HELMSUBST_DEPLOYMENT_AUDIT_AFFINITY: ""`: `{{- toYaml .Values.audit.affinity | nindent 8 }}`,

`HELMSUBST_DEPLOYMENT_AUDIT_SECURITY_CONTEXT: ""`: `{{- toYaml .Values.audit.securityContext | nindent 10}}`,
`HELMSUBST_DEPLOYMENT_AUDIT_SECURITY_CONTEXT: ""`: `{{- if .Values.enableRuntimeDefaultSeccompProfile }}
seccompProfile:
type: RuntimeDefault
{{- end }}
{{- toYaml .Values.audit.securityContext | nindent 10}}`,

`HELMSUBST_DEPLOYMENT_AUDIT_TOLERATIONS: ""`: `{{- toYaml .Values.audit.tolerations | nindent 8 }}`,

Expand All @@ -39,7 +43,11 @@ var replacements = map[string]string{

`HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_AFFINITY: ""`: `{{- toYaml .Values.controllerManager.affinity | nindent 8 }}`,

`HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_SECURITY_CONTEXT: ""`: `{{- toYaml .Values.controllerManager.securityContext | nindent 10}}`,
`HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_SECURITY_CONTEXT: ""`: `{{- if .Values.enableRuntimeDefaultSeccompProfile }}
seccompProfile:
type: RuntimeDefault
{{- end }}
{{- toYaml .Values.controllerManager.securityContext | nindent 10}}`,

`HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_TOLERATIONS: ""`: `{{- toYaml .Values.controllerManager.tolerations | nindent 8 }}`,

Expand All @@ -49,7 +57,9 @@ var replacements = map[string]string{

"HELMSUBST_DEPLOYMENT_REPLICAS": `{{ .Values.replicas }}`,

`HELMSUBST_ANNOTATIONS: ""`: `{{- toYaml .Values.podAnnotations | trim | nindent 8 }}`,
`HELMSUBST_ANNOTATIONS: ""`: `{{- if .Values.podAnnotations }}
{{- toYaml .Values.podAnnotations | trim | nindent 8 }}
{{- end }}`,

"HELMSUBST_SECRET_ANNOTATIONS": `{{- toYaml .Values.secretAnnotations | trim | nindent 4 }}`,

Expand Down
4 changes: 2 additions & 2 deletions cmd/build/helmify/static/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ image:
release: v3.9.0-beta.2
pullPolicy: IfNotPresent
pullSecrets: []
podAnnotations:
{container.seccomp.security.alpha.kubernetes.io/manager: runtime/default}
podAnnotations: {}
podLabels: {}
podCountLimit: 100
secretAnnotations: {}
enableRuntimeDefaultSeccompProfile: true
controllerManager:
exemptNamespaces: []
exemptNamespacePrefixes: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ spec:
template:
metadata:
annotations:
{{- if .Values.podAnnotations }}
{{- toYaml .Values.podAnnotations | trim | nindent 8 }}
{{- end }}
labels:
{{- include "gatekeeper.podLabels" . }}
app: '{{ template "gatekeeper.name" . }}'
Expand Down Expand Up @@ -103,6 +105,10 @@ spec:
resources:
{{- toYaml .Values.audit.resources | nindent 10 }}
securityContext:
{{- if .Values.enableRuntimeDefaultSeccompProfile }}
seccompProfile:
type: RuntimeDefault
{{- end }}
{{- toYaml .Values.audit.securityContext | nindent 10}}
volumeMounts:
- mountPath: /tmp/audit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ spec:
template:
metadata:
annotations:
{{- if .Values.podAnnotations }}
{{- toYaml .Values.podAnnotations | trim | nindent 8 }}
{{- end }}
labels:
{{- include "gatekeeper.podLabels" . }}
app: '{{ template "gatekeeper.name" . }}'
Expand Down Expand Up @@ -118,6 +120,10 @@ spec:
resources:
{{- toYaml .Values.controllerManager.resources | nindent 10 }}
securityContext:
{{- if .Values.enableRuntimeDefaultSeccompProfile }}
seccompProfile:
type: RuntimeDefault
{{- end }}
{{- toYaml .Values.controllerManager.securityContext | nindent 10}}
volumeMounts:
- mountPath: /certs
Expand Down
4 changes: 2 additions & 2 deletions manifest_staging/charts/gatekeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ image:
release: v3.9.0-beta.2
pullPolicy: IfNotPresent
pullSecrets: []
podAnnotations:
{container.seccomp.security.alpha.kubernetes.io/manager: runtime/default}
podAnnotations: {}
podLabels: {}
podCountLimit: 100
secretAnnotations: {}
enableRuntimeDefaultSeccompProfile: true
controllerManager:
exemptNamespaces: []
exemptNamespacePrefixes: []
Expand Down

0 comments on commit 0686ec8

Please sign in to comment.