From 1c4f2fe4e8b7293e7dc36b92a25f5b364e987159 Mon Sep 17 00:00:00 2001 From: VladyslavTokar <33702283+VladyslavTokar@users.noreply.github.com> Date: Wed, 15 Jan 2020 06:05:31 +0200 Subject: [PATCH] [stable/elasticsearch-exporter] Enabling environment from secrets (#19115) * [stable/elasticsearch-exporter] Enabling environment from secrets Signed-off-by: VladyslavTokar * [stable/elasticsearch-exporter] Update description for envFromSecret parameter in readme Signed-off-by: VladyslavTokar --- stable/elasticsearch-exporter/Chart.yaml | 2 +- stable/elasticsearch-exporter/README.md | 1 + stable/elasticsearch-exporter/templates/deployment.yaml | 5 +++++ stable/elasticsearch-exporter/values.yaml | 6 +++++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/stable/elasticsearch-exporter/Chart.yaml b/stable/elasticsearch-exporter/Chart.yaml index a25e6f9310..b165e4229c 100644 --- a/stable/elasticsearch-exporter/Chart.yaml +++ b/stable/elasticsearch-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Elasticsearch stats exporter for Prometheus name: elasticsearch-exporter -version: 2.1.1 +version: 2.2.0 kubeVersion: ">=1.10.0-0" appVersion: 1.1.0 home: https://github.com/justwatchcom/elasticsearch_exporter diff --git a/stable/elasticsearch-exporter/README.md b/stable/elasticsearch-exporter/README.md index 925f4d5e8d..4225e84b9a 100644 --- a/stable/elasticsearch-exporter/README.md +++ b/stable/elasticsearch-exporter/README.md @@ -72,6 +72,7 @@ Parameter | Description | Default `service.annotations` | Annotations on the http service | `{}` `service.labels` | Additional labels for the service definition | `{}` `env` | Extra environment variables passed to pod | `{}` +`envFromSecret` | The name of an existing secret in the same kubernetes namespace which contains values to be added to the environment | `nil` `secretMounts` | list of secrets and their paths to mount inside the pod | `[]` `affinity` | Affinity rules | `{}` `es.uri` | address of the Elasticsearch node to connect to | `localhost:9200` diff --git a/stable/elasticsearch-exporter/templates/deployment.yaml b/stable/elasticsearch-exporter/templates/deployment.yaml index 445bad164b..6058518346 100644 --- a/stable/elasticsearch-exporter/templates/deployment.yaml +++ b/stable/elasticsearch-exporter/templates/deployment.yaml @@ -55,6 +55,11 @@ spec: value: "{{ $value }}" {{- end }} {{- end }} + {{- if .Values.envFromSecret }} + envFrom: + - secretRef: + name: {{ .Values.envFromSecret }} + {{- end }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: ["elasticsearch_exporter", diff --git a/stable/elasticsearch-exporter/values.yaml b/stable/elasticsearch-exporter/values.yaml index 2ddce73dad..4c5ca779a6 100644 --- a/stable/elasticsearch-exporter/values.yaml +++ b/stable/elasticsearch-exporter/values.yaml @@ -51,7 +51,11 @@ service: ## env: ## KEY_1: value1 ## KEY_2: value2 -# env: +env: {} + +## 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: "" # A list of secrets and their paths to mount inside the pod # This is useful for mounting certificates for security