From b8f5be0fcef8b93f8dbbb493dd6a20cc46f651e1 Mon Sep 17 00:00:00 2001 From: RAHUL KHIYANI Date: Mon, 22 Apr 2019 01:16:29 -0500 Subject: [PATCH] Nagios: Fix security context This PS fixes the use of the security context macros for the nagios chart. Change-Id: Ibe7ca7b87153f4e5535b9c8b1bf1ba63edb5e3af --- nagios/templates/deployment.yaml | 3 +++ nagios/values.yaml | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/nagios/templates/deployment.yaml b/nagios/templates/deployment.yaml index 24cd7f51f..f910f94b6 100644 --- a/nagios/templates/deployment.yaml +++ b/nagios/templates/deployment.yaml @@ -82,6 +82,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" "monitoring" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} nodeSelector: {{ .Values.labels.nagios.node_selector_key }}: {{ .Values.labels.nagios.node_selector_value | quote }} @@ -97,6 +98,7 @@ spec: - name: apache-proxy {{ tuple $envAll "apache_proxy" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.apache_proxy | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} +{{ dict "envAll" $envAll "application" "monitoring" "container" "apache_proxy" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} command: - /tmp/apache.sh - start @@ -133,6 +135,7 @@ spec: - name: nagios {{ tuple $envAll "nagios" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.nagios | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} +{{ dict "envAll" $envAll "application" "monitoring" "container" "nagios" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} ports: - name: nagios containerPort: {{ tuple "nagios" "internal" "nagios" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} diff --git a/nagios/values.yaml b/nagios/values.yaml index 65cd7a800..553d809b2 100644 --- a/nagios/values.yaml +++ b/nagios/values.yaml @@ -193,6 +193,15 @@ network_policy: - {} pod: + security_context: + monitoring: + pod: + runAsUser: 0 + container: + apache_proxy: + readOnlyRootFilesystem: false + nagios: + readOnlyRootFilesystem: false lifecycle: upgrades: revision_history: 3