From 28faaf8da04dab9cc646c9994f6bcaa45d3fbd6b Mon Sep 17 00:00:00 2001 From: Alex Didenko Date: Mon, 19 Mar 2018 14:53:59 +0100 Subject: [PATCH] [stable/prometheus] extraSecretMounts support (#4059) * [stable/prometheus] extraSecretMounts support Sometimes you need to monitor external services and sometimes those services have authentication mechanisms, like TLS. For example, you need to monitor external Etcd cluster. In such case it would be handy to put all the TLS files into Kubernetes Secret and then mount them into Prometheus Server pod, instead of distributing them on all the worker nodes and using hostPath mounts. * Incrementing the chart version --- stable/prometheus/Chart.yaml | 2 +- stable/prometheus/README.md | 1 + stable/prometheus/templates/server-deployment.yaml | 10 ++++++++++ stable/prometheus/values.yaml | 8 ++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/stable/prometheus/Chart.yaml b/stable/prometheus/Chart.yaml index 5132e3c658..84f8e46970 100755 --- a/stable/prometheus/Chart.yaml +++ b/stable/prometheus/Chart.yaml @@ -1,5 +1,5 @@ name: prometheus -version: 5.4.3 +version: 5.4.4 description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/assets/prometheus_logo-cb55bb5c346.png diff --git a/stable/prometheus/README.md b/stable/prometheus/README.md index dd0270bb98..577e570894 100644 --- a/stable/prometheus/README.md +++ b/stable/prometheus/README.md @@ -210,6 +210,7 @@ Parameter | Description | Default `server.baseURL` | The external url at which the server can be accessed | `` `server.extraHostPathMounts` | Additional Prometheus server hostPath mounts | `[]` `server.extraConfigmapMounts` | Additional Prometheus server configMap mounts | `[]` +`server.extraSecretMounts` | Additional Prometheus server Secret mounts | `[]` `server.configMapOverrideName` | Prometheus server ConfigMap override where full-name is `{{.Release.Name}}-{{.Values.server.configMapOverrideName}}` and setting this value will prevent the default server ConfigMap from being generated | `""` `server.ingress.enabled` | If true, Prometheus server Ingress will be created | `false` `server.ingress.annotations` | Prometheus server Ingress annotations | `[]` diff --git a/stable/prometheus/templates/server-deployment.yaml b/stable/prometheus/templates/server-deployment.yaml index f6fd90245c..6cd9c98202 100644 --- a/stable/prometheus/templates/server-deployment.yaml +++ b/stable/prometheus/templates/server-deployment.yaml @@ -104,6 +104,11 @@ spec: mountPath: {{ .mountPath }} readOnly: {{ .readOnly }} {{- end }} + {{- range .Values.server.extraSecretMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + readOnly: {{ .readOnly }} + {{- end }} {{- if .Values.server.nodeSelector }} nodeSelector: {{ toYaml .Values.server.nodeSelector | indent 8 }} @@ -138,3 +143,8 @@ spec: configMap: name: {{ .configMap }} {{- end }} + {{- range .Values.server.extraSecretMounts }} + - name: {{ .name }} + secret: + secretName: {{ .secretName }} + {{- end }} diff --git a/stable/prometheus/values.yaml b/stable/prometheus/values.yaml index 9abc7d746e..b431972715 100644 --- a/stable/prometheus/values.yaml +++ b/stable/prometheus/values.yaml @@ -418,6 +418,14 @@ server: # configMap: certs-configmap # readOnly: true + ## Additional Prometheus server Secret mounts + # Defines additional mounts with secrets. Secrets must be manually created in the namespace. + extraSecretMounts: [] + # - name: secret-files + # mountPath: /etc/secrets + # secretName: prom-secret-files + # readOnly: true + ## ConfigMap override where fullname is {{.Release.Name}}-{{.Values.server.configMapOverrideName}} ## Defining configMapOverrideName will cause templates/server-configmap.yaml ## to NOT generate a ConfigMap resource