Skip to content

Commit

Permalink
feat: add the ability to set serviceAccount annotations for Prometheu…
Browse files Browse the repository at this point in the history
…sOperator (#4820)

Co-authored-by: Gabriel Martinez <[email protected]>
Co-authored-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
3 people authored Sep 12, 2024
1 parent 1529cd7 commit 6a6225d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 62.6.0
version: 62.7.0
appVersion: v0.76.1
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
labels:
app: {{ template "kube-prometheus-stack.name" . }}-operator
{{- include "kube-prometheus-stack.prometheus-operator-webhook.labels" . | indent 4 }}
{{- with .Values.prometheusOperator.admissionWebhooks.deployment.serviceAccount.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{ include "kube-prometheus-stack.imagePullSecrets" . | trim | indent 2 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ metadata:
labels:
app: {{ template "kube-prometheus-stack.name" $ }}-admission
{{- include "kube-prometheus-stack.prometheus-operator-webhook.labels" $ | nindent 4 }}
{{- with .Values.prometheusOperator.admissionWebhooks.patch.serviceAccount.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.prometheusOperator.admissionWebhooks.patch.serviceAccount.automountServiceAccountToken }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ metadata:
namespace: {{ template "kube-prometheus-stack.namespace" . }}
labels:
{{- include "kube-prometheus-stack.prometheus-operator.labels" . | nindent 4 }}
{{- with .Values.prometheusOperator.serviceAccount.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.prometheusOperator.serviceAccount.automountServiceAccountToken }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
Expand Down
3 changes: 3 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2310,6 +2310,7 @@ prometheusOperator:
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
serviceAccount:
annotations: {}
automountServiceAccountToken: false
create: true
name: ""
Expand Down Expand Up @@ -2531,6 +2532,7 @@ prometheusOperator:
##
serviceAccount:
create: true
annotations: {}
automountServiceAccountToken: true

# Security context for create job container
Expand Down Expand Up @@ -2612,6 +2614,7 @@ prometheusOperator:
create: true
name: ""
automountServiceAccountToken: true
annotations: {}

## Configuration for Prometheus operator service
##
Expand Down

0 comments on commit 6a6225d

Please sign in to comment.