From 3a3169f2a20ecc54dd69ece3fe146a0ac491f6ee Mon Sep 17 00:00:00 2001 From: Wei Tie <4032269+tiewei@users.noreply.github.com> Date: Fri, 3 Aug 2018 09:39:26 -0700 Subject: [PATCH] [stable/grafana] Add support for overriding securityContext (#6948) grafana < 5.1 are using 104 as user ID, in order to support upgrading from older version, overridding the grafana image tag with older version, or adding more securityContext, this change allows setting `securityContext` in more flexible way. --- stable/grafana/Chart.yaml | 2 +- stable/grafana/README.md | 1 + stable/grafana/templates/deployment.yaml | 5 +++-- stable/grafana/values.yaml | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/stable/grafana/Chart.yaml b/stable/grafana/Chart.yaml index ceb14e605d..d9bc817bfe 100755 --- a/stable/grafana/Chart.yaml +++ b/stable/grafana/Chart.yaml @@ -1,5 +1,5 @@ name: grafana -version: 1.12.0 +version: 1.13.0 appVersion: 5.1.3 kubeVersion: "^1.8.0-0" description: The leading tool for querying and visualizing time series and metrics. diff --git a/stable/grafana/README.md b/stable/grafana/README.md index 1065dabe98..b9871c0a2b 100644 --- a/stable/grafana/README.md +++ b/stable/grafana/README.md @@ -34,6 +34,7 @@ The command removes all the Kubernetes components associated with the chart and |----------------------------|-------------------------------------|---------------------------------------------------------| | `replicas` | Number of nodes | `1` | | `deploymentStrategy` | Deployment strategy | `RollingUpdate` | +| `securityContext` | Deployment securityContext | `{"runAsUser": 472, "fsGroup": 472}` | | `image.repository` | Image repository | `grafana/grafana` | | `image.tag` | Image tag. (`Must be >= 5.0.0`) Possible values listed [here](https://hub.docker.com/r/grafana/grafana/tags/).| `5.0.4`| | `image.pullPolicy` | Image pull policy | `IfNotPresent` | diff --git a/stable/grafana/templates/deployment.yaml b/stable/grafana/templates/deployment.yaml index c14c6f1885..fbbb823305 100644 --- a/stable/grafana/templates/deployment.yaml +++ b/stable/grafana/templates/deployment.yaml @@ -33,9 +33,10 @@ spec: {{- if .Values.schedulerName }} schedulerName: "{{ .Values.schedulerName }}" {{- end }} +{{- if .Values.securityContext }} securityContext: - runAsUser: 472 - fsGroup: 472 +{{ toYaml .Values.securityContext | indent 8 }} +{{- end }} {{- if .Values.dashboards }} initContainers: - name: download-dashboards diff --git a/stable/grafana/values.yaml b/stable/grafana/values.yaml index 2f9ba4fc92..c940b3829e 100644 --- a/stable/grafana/values.yaml +++ b/stable/grafana/values.yaml @@ -21,6 +21,10 @@ image: # pullSecrets: # - myRegistrKeySecretName +securityContext: + runAsUser: 472 + fsGroup: 472 + downloadDashboardsImage: repository: appropriate/curl tag: latest