controller_manager: Add pod/container security context

This updates the controller_manager chart to include the pod
security context on the pod template

This also adds the container security context to set
readOnlyRootFilesystem to true

Change-Id: Icee324ef7ddbd230c7c99f4dc284e2866d9acf1a
This commit is contained in:
RAHUL KHIYANI 2019-04-09 20:31:09 -05:00 committed by Rahul Khiyani
parent b6c3decf22
commit 34aca639f0
2 changed files with 9 additions and 0 deletions

View File

@ -42,6 +42,7 @@ spec:
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec:
{{ dict "envAll" $envAll "application" "kubernetes" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
nodeSelector:
{{ .Values.labels.controller_manager.node_selector_key }}: {{ .Values.labels.controller_manager.node_selector_value }}
dnsPolicy: {{ .Values.anchor.dns_policy }}
@ -62,6 +63,7 @@ spec:
- name: ETC_PATH
value: /host{{ .Values.controller_manager.host_etc_path }}
{{ tuple $envAll $envAll.Values.pod.resources.anchor_pod | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "kubernetes" "container" "anchor" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- /tmp/bin/anchor
lifecycle:

View File

@ -78,6 +78,13 @@ dependencies:
controller_manager:
pod:
security_context:
kubernetes:
pod:
runAsUser: 0
container:
anchor:
readOnlyRootFilesystem: true
mounts:
controller_manager:
init_container: null