Skip to content

Commit

Permalink
Add feature for custom key. (prometheus-community#723)
Browse files Browse the repository at this point in the history
Signed-off-by: Whyeasy <[email protected]>
  • Loading branch information
Whyeasy authored Mar 3, 2021
1 parent 820c7a3 commit d34bd7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-stackdriver-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: Stackdriver exporter for Prometheus
name: prometheus-stackdriver-exporter
version: 1.8.0
version: 1.8.1
appVersion: 0.11.0
home: https://www.stackdriver.com/
sources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ spec:
- name: stackdriver-service-account
secret:
secretName: {{ .Values.stackdriver.serviceAccountSecret | quote }}
{{- if and (.Values.stackdriver.serviceAccountSecret) (.Values.stackdriver.serviceAccountSecretKey) }}
items:
- key: {{ .Values.stackdriver.serviceAccountSecretKey | quote }}
path: credentials.json
{{- end }}
{{- else if .Values.stackdriver.serviceAccountKey }}
- name: stackdriver-service-account
secret:
Expand Down Expand Up @@ -108,4 +113,3 @@ spec:
tolerations:
{{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}

2 changes: 2 additions & 0 deletions charts/prometheus-stackdriver-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ stackdriver:
projectId: "FALSE"
# An existing secret which contains credentials.json
serviceAccountSecret: ""
# Provide custom key for the existing secret to load credentials.json from
serviceAccountSecretKey: ""
# A service account key JSON file. Must be provided when no existing secret is used, in this case a new secret will be created holding this service account
serviceAccountKey: ""
# Max number of retries that should be attempted on 503 errors from Stackdriver
Expand Down

0 comments on commit d34bd7f

Please sign in to comment.