diff --git a/stable/prometheus-postgres-exporter/Chart.yaml b/stable/prometheus-postgres-exporter/Chart.yaml index f5d1065a0d..1205b01d2d 100644 --- a/stable/prometheus-postgres-exporter/Chart.yaml +++ b/stable/prometheus-postgres-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "0.4.6" description: A Helm chart for prometheus postgres-exporter name: prometheus-postgres-exporter -version: 0.3.0 +version: 0.4.0 home: https://github.com/wrouesnel/postgres_exporter sources: - https://github.com/wrouesnel/postgres_exporter diff --git a/stable/prometheus-postgres-exporter/README.md b/stable/prometheus-postgres-exporter/README.md index bc25f1bec3..aa70d76604 100644 --- a/stable/prometheus-postgres-exporter/README.md +++ b/stable/prometheus-postgres-exporter/README.md @@ -55,6 +55,8 @@ The following table lists the configurable parameters of the postgres Exporter c | `nodeSelector` | node labels for pod assignment | `{}` | | `affinity` | node/pod affinities | `{}` | | `annotations` | Deployment annotations | `{}` | +| `extraContainers` | Additional sidecar containers | `""` | +| `extraVolumes` | Additional volumes for use in extraContainers | `""` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/stable/prometheus-postgres-exporter/templates/deployment.yaml b/stable/prometheus-postgres-exporter/templates/deployment.yaml index 63a16c33d9..be5a3e09a1 100644 --- a/stable/prometheus-postgres-exporter/templates/deployment.yaml +++ b/stable/prometheus-postgres-exporter/templates/deployment.yaml @@ -29,7 +29,7 @@ spec: - name: {{ .Chart.Name }} args: - "--extend.query-path=/etc/config.yaml" - env: + env: - name: DATA_SOURCE_NAME valueFrom: secretKeyRef: @@ -55,6 +55,9 @@ spec: - name: queries mountPath: /etc/config.yaml subPath: config.yaml +{{- with .Values.extraContainers }} +{{ tpl . $ | indent 8 }} +{{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} @@ -71,4 +74,7 @@ spec: - configMap: defaultMode: 420 name: {{ template "prometheus-postgres-exporter.fullname" . }} - name: queries \ No newline at end of file + name: queries +{{- with .Values.extraVolumes }} +{{ tpl . $ | indent 6 }} +{{- end }} diff --git a/stable/prometheus-postgres-exporter/templates/secrets.yaml b/stable/prometheus-postgres-exporter/templates/secrets.yaml index cf8fe2f540..5bd51ed150 100644 --- a/stable/prometheus-postgres-exporter/templates/secrets.yaml +++ b/stable/prometheus-postgres-exporter/templates/secrets.yaml @@ -9,4 +9,4 @@ metadata: release: {{ .Release.Name }} type: Opaque data: - data_source_name: "{{ printf "postgresql://%s:%s@%s:%s/?sslmode=%s" .Values.config.datasource.user .Values.config.datasource.password .Values.config.datasource.host .Values.config.datasource.port .Values.config.datasource.sslmode | b64enc }}" + data_source_name: "{{ printf "postgresql://%s:%s@%s:%s/%s?sslmode=%s" .Values.config.datasource.user .Values.config.datasource.password .Values.config.datasource.host .Values.config.datasource.port .Values.config.datasource.database .Values.config.datasource.sslmode | b64enc }}" diff --git a/stable/prometheus-postgres-exporter/values.yaml b/stable/prometheus-postgres-exporter/values.yaml index 885153d7ed..b740095dce 100644 --- a/stable/prometheus-postgres-exporter/values.yaml +++ b/stable/prometheus-postgres-exporter/values.yaml @@ -44,6 +44,7 @@ config: user: password: port: "5432" + database: '' sslmode: disable # this are the defaults queries that the exporter will run, extracted from: https://github.com/wrouesnel/postgres_exporter/blob/master/queries.yaml queries: |- @@ -145,3 +146,9 @@ tolerations: [] affinity: {} annotations: {} + +# Additional sidecar containers, e. g. for a database proxy, such as Google's cloudsql-proxy +extraContainers: | + +# Additional volumes, e. g. for secrets used in an extraContainer +extraVolumes: |