Skip to content

Commit

Permalink
[stable/grafana] Support env valueFrom entries (helm#19605)
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
  • Loading branch information
hairyhenderson authored and k8s-ci-robot committed Dec 14, 2019
1 parent 1a2ae3d commit cd39538
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/grafana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: grafana
version: 4.1.3
version: 4.2.0
appVersion: 6.5.0
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
Expand Down
1 change: 1 addition & 0 deletions stable/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ This version requires Helm >= 2.12.0.
| `initChownData.resources` | init-chown-data pod resource requests & limits | `{}` |
| `schedulerName` | Alternate scheduler name | `nil` |
| `env` | Extra environment variables passed to pods | `{}` |
| `envValueFrom` | Environment variables from alternate sources. See the API docs on [EnvVarSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#envvarsource-v1-core) for format details. | `{}` |
| `envFromSecret` | Name of a Kubernetes secret (must be manually created in the same namespace) containing values to be added to the environment | `""` |
| `envRenderSecret` | Sensible environment variables passed to pods and stored as secret | `{}` |
| `extraSecretMounts` | Additional grafana server secret mounts | `[]` |
Expand Down
5 changes: 5 additions & 0 deletions stable/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ containers:
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- range $key, $value := .Values.envValueFrom }}
- name: {{ $key | quote }}
valueFrom:
{{ toYaml $value | indent 10 }}
{{- end }}
{{- if .Values.envFromSecret }}
envFrom:
- secretRef:
Expand Down
10 changes: 10 additions & 0 deletions stable/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,16 @@ admin:
## Extra environment variables that will be pass onto deployment pods
env: {}

## "valueFrom" environment variable references that will be added to deployment pods
## ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#envvarsource-v1-core
## Renders in container spec as:
## env:
## ...
## - name: <key>
## valueFrom:
## <value rendered as YAML>
envValueFrom: {}

## The name of a secret in the same kubernetes namespace which contain values to be added to the environment
## This can be useful for auth tokens, etc
envFromSecret: ""
Expand Down

0 comments on commit cd39538

Please sign in to comment.