diff --git a/stable/prometheus-mongodb-exporter/Chart.yaml b/stable/prometheus-mongodb-exporter/Chart.yaml index 78ac4aec32..14539bafcb 100644 --- a/stable/prometheus-mongodb-exporter/Chart.yaml +++ b/stable/prometheus-mongodb-exporter/Chart.yaml @@ -13,4 +13,4 @@ maintainers: name: prometheus-mongodb-exporter sources: - https://github.com/percona/mongodb_exporter -version: 2.0.1 +version: 2.1.0 diff --git a/stable/prometheus-mongodb-exporter/README.md b/stable/prometheus-mongodb-exporter/README.md index 85113e5da6..59c5d1e5de 100644 --- a/stable/prometheus-mongodb-exporter/README.md +++ b/stable/prometheus-mongodb-exporter/README.md @@ -16,7 +16,7 @@ This command deploys the MongoDB Exporter with the default configuration. The [c ## Using the Chart To use the chart, ensure the `mongodb.uri` is populated with a valid [MongoDB URI](https://docs.mongodb.com/manual/reference/connection-string). -If the MongoDB server requires authentication, credentials should be populated in the connection string as well. The MongoDB Exporter supports +If the MongoDB server requires authentication, credentials should be populated in the connection string as well. The MongoDB Exporter supports connecting to either a MongoDB replica set member, shard, or standalone instance. The chart comes with a ServiceMonitor for use with the [Prometheus Operator](https://github.com/helm/charts/tree/master/stable/prometheus-operator). diff --git a/stable/prometheus-mongodb-exporter/templates/deployment.yaml b/stable/prometheus-mongodb-exporter/templates/deployment.yaml index 63eb660cd4..a150d005df 100644 --- a/stable/prometheus-mongodb-exporter/templates/deployment.yaml +++ b/stable/prometheus-mongodb-exporter/templates/deployment.yaml @@ -25,8 +25,13 @@ spec: spec: containers: - name: mongodb-exporter - {{- if .Values.env }} env: + - name: MONGODB_URI + valueFrom: + secretKeyRef: + name: {{ include "prometheus-mongodb-exporter.fullname" . }} + key: mongodb-uri + {{- if .Values.env }} {{- range $key, $value := .Values.env }} - name: "{{ $key }}" value: "{{ $value }}" @@ -35,7 +40,6 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: - - --mongodb.uri={{ required "A MongoDB URI is required" .Values.mongodb.uri }} - --web.listen-address={{ printf ":%s" .Values.port }} {{- toYaml .Values.extraArgs | nindent 8 }} ports: diff --git a/stable/prometheus-mongodb-exporter/templates/secret.yaml b/stable/prometheus-mongodb-exporter/templates/secret.yaml new file mode 100644 index 0000000000..9a7ca8a299 --- /dev/null +++ b/stable/prometheus-mongodb-exporter/templates/secret.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "prometheus-mongodb-exporter.fullname" . }} + labels: + app.kubernetes.io/name: {{ include "prometheus-mongodb-exporter.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + helm.sh/chart: {{ include "prometheus-mongodb-exporter.chart" . }} +type: Opaque +data: + mongodb-uri: {{ required "A MongoDB URI is required" .Values.mongodb.uri | b64enc }}