From cb1bd3c6d738aae4cc906b2ca172101c9aa4ab81 Mon Sep 17 00:00:00 2001 From: "KHIYANI, RAHUL (rk0850)" Date: Tue, 8 Sep 2020 11:58:35 -0500 Subject: [PATCH] Add security context template at pod/container level for etcd chart This change implements runAsUser flag at pod level and readOnly-fs flag at container level Change-Id: Idcb78a1125b51e3b2a71c8cab0e97246c3f1c5aa --- etcd/templates/deployment.yaml | 2 ++ etcd/values.yaml | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/etcd/templates/deployment.yaml b/etcd/templates/deployment.yaml index bfb39b81eb..494ad5575a 100644 --- a/etcd/templates/deployment.yaml +++ b/etcd/templates/deployment.yaml @@ -40,6 +40,7 @@ spec: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} spec: +{{ dict "envAll" $envAll "application" "etcd" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $rcControllerName | quote }} affinity: {{ tuple $envAll "etcd" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} @@ -50,6 +51,7 @@ spec: containers: - name: etcd {{ tuple $envAll "etcd" | include "helm-toolkit.snippets.image" | indent 10 }} +{{ dict "envAll" $envAll "application" "etcd" "container" "etcd" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} command: - /tmp/etcd.sh ports: diff --git a/etcd/values.yaml b/etcd/values.yaml index 9dea5b888b..5e74a531fd 100644 --- a/etcd/values.yaml +++ b/etcd/values.yaml @@ -51,6 +51,14 @@ dependencies: jobs: null pod: + security_context: + etcd: + pod: + runAsUser: 65534 + container: + etcd: + runAsUser: 0 + readOnlyRootFilesystem: false affinity: anti: type: