From 39dfa9f52b72f3e343138cc8a85456375067c150 Mon Sep 17 00:00:00 2001 From: Kangseok Thomas Lee Date: Mon, 3 Dec 2018 05:04:57 +0900 Subject: [PATCH] [stable/prometheus-node-exporter] add securityContext value (#9618) it needs to be configurable. Signed-off-by: gangseok.lee --- stable/prometheus-node-exporter/Chart.yaml | 2 +- stable/prometheus-node-exporter/README.md | 1 + stable/prometheus-node-exporter/templates/daemonset.yaml | 5 +++-- stable/prometheus-node-exporter/values.yaml | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/stable/prometheus-node-exporter/Chart.yaml b/stable/prometheus-node-exporter/Chart.yaml index ff2205cf15..91c7ab17c0 100644 --- a/stable/prometheus-node-exporter/Chart.yaml +++ b/stable/prometheus-node-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "0.16.0" description: A Helm chart for prometheus node-exporter name: prometheus-node-exporter -version: 0.6.0 +version: 0.6.1 home: https://github.com/prometheus/node_exporter/ sources: - https://github.com/prometheus/node_exporter/ diff --git a/stable/prometheus-node-exporter/README.md b/stable/prometheus-node-exporter/README.md index 12659ac725..74caa90d3d 100644 --- a/stable/prometheus-node-exporter/README.md +++ b/stable/prometheus-node-exporter/README.md @@ -54,6 +54,7 @@ The following table lists the configurable parameters of the Node Exporter chart | `serviceAccount.create` | Specifies whether a service account should be created. | `true` | | | `serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the fullname template | | | | `serviceAccount.imagePullSecrets` | Specify image pull secrets | `[]` | | +| `securityContext` | SecurityContext | `{"runAsNonRoot": true, "runAsUser": 65534}` | | | `tolerations` | List of node taints to tolerate | `- effect: NoSchedule operator: Exists` | | | `priorityClassName` | Name of Priority Class to assign pods | `nil` | | diff --git a/stable/prometheus-node-exporter/templates/daemonset.yaml b/stable/prometheus-node-exporter/templates/daemonset.yaml index 01685dca42..a6687d5bc0 100644 --- a/stable/prometheus-node-exporter/templates/daemonset.yaml +++ b/stable/prometheus-node-exporter/templates/daemonset.yaml @@ -19,9 +19,10 @@ spec: {{- if and .Values.rbac.create .Values.serviceAccount.create }} serviceAccountName: {{ template "prometheus-node-exporter.serviceAccountName" . }} {{- end }} +{{- if .Values.securityContext }} securityContext: - runAsNonRoot: true - runAsUser: 65534 +{{ toYaml .Values.securityContext | indent 8 }} +{{- end }} {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} {{- end }} diff --git a/stable/prometheus-node-exporter/values.yaml b/stable/prometheus-node-exporter/values.yaml index 38a705978e..7d3fc76a09 100644 --- a/stable/prometheus-node-exporter/values.yaml +++ b/stable/prometheus-node-exporter/values.yaml @@ -33,6 +33,10 @@ serviceAccount: name: imagePullSecrets: [] +securityContext: + runAsNonRoot: true + runAsUser: 65534 + rbac: ## If true, create & use RBAC resources ##