Skip to content

Commit

Permalink
Adding secret support for oauth psidecar (prometheus-community#486)
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Bürgisser <[email protected]>
  • Loading branch information
pburgisser authored Jan 29, 2021
1 parent 47eb420 commit 18689d9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-node-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: 1.0.1
description: A Helm chart for prometheus node-exporter
name: prometheus-node-exporter
version: 1.12.0
version: 1.13.0
home: https://github.com/prometheus/node_exporter/
sources:
- https://github.com/prometheus/node_exporter/
Expand Down
15 changes: 14 additions & 1 deletion charts/prometheus-node-exporter/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
{{- end }}
ports:
- name: metrics
containerPort: {{ .Values.service.targetPort }}
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
httpGet:
Expand Down Expand Up @@ -100,6 +100,12 @@ spec:
- name: {{ $mount.name }}
mountPath: {{ $mount.mountPath }}
{{- end }}
{{- if .Values.secrets }}
{{- range $_, $mount := .Values.secrets }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.sidecars }}
{{ toYaml .Values.sidecars | indent 8 }}
Expand Down Expand Up @@ -157,3 +163,10 @@ spec:
name: {{ $mount.name }}
{{- end }}
{{- end }}
{{- if .Values.secrets }}
{{- range $_, $mount := .Values.secrets }}
- name: {{ $mount.name }}
secret:
secretName: {{ $mount.name }}
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/prometheus-node-exporter/templates/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ spec:
release: {{ .Release.Name }}
endpoints:
- port: metrics
scheme: {{ $.Values.prometheus.monitor.scheme }}
{{- if $.Values.prometheus.monitor.bearerTokenFile }}
bearerTokenFile: {{ $.Values.prometheus.monitor.bearerTokenFile }}
{{- end }}
{{- if $.Values.prometheus.monitor.tlsConfig }}
tlsConfig: {{ toYaml $.Values.prometheus.monitor.tlsConfig | nindent 8 }}
{{- end }}
{{- if .Values.prometheus.monitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.prometheus.monitor.scrapeTimeout }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/prometheus-node-exporter/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ metadata:
chart: {{ template "prometheus-node-exporter.chart" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
{{ toYaml .Values.serviceAccount.annotations | indent 4 }}
imagePullSecrets:
{{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }}
{{- end -}}
Expand Down
8 changes: 7 additions & 1 deletion charts/prometheus-node-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ prometheus:
enabled: false
additionalLabels: {}
namespace: ""
scheme: http
bearerTokenFile:
tlsConfig: {}

relabelings: []
scrapeTimeout: 10s
Expand Down Expand Up @@ -48,6 +51,7 @@ serviceAccount:
# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the fullname template
name:
annotations: {}
imagePullSecrets: []

securityContext:
Expand Down Expand Up @@ -122,7 +126,9 @@ extraHostVolumeMounts: []
configmaps: []
# - name: <configMapName>
# mountPath: <mountPath>

secrets: []
# - name: <secretName>
# mountPath: <mountPatch>
## Override the deployment namespace
##
namespaceOverride: ""
Expand Down

0 comments on commit 18689d9

Please sign in to comment.