Skip to content

Commit

Permalink
[kube-prometheus-stack] Add automountServiceAccountToken option (prom…
Browse files Browse the repository at this point in the history
…etheus-community#4285)

Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
  • Loading branch information
emilkor1 and jkroepke authored Feb 26, 2024
1 parent 2a7ea2f commit 7569872
Show file tree
Hide file tree
Showing 7 changed files with 20 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: 56.11.0
version: 56.12.0
appVersion: v0.71.2
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 @@ -31,6 +31,7 @@ spec:
replicas: {{ .Values.alertmanager.alertmanagerSpec.replicas }}
listenLocal: {{ .Values.alertmanager.alertmanagerSpec.listenLocal }}
serviceAccountName: {{ template "kube-prometheus-stack.alertmanager.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.alertmanager.alertmanagerSpec.automountServiceAccountToken }}
{{- if .Values.alertmanager.alertmanagerSpec.externalUrl }}
externalUrl: "{{ tpl .Values.alertmanager.alertmanagerSpec.externalUrl . }}"
{{- else if and .Values.alertmanager.ingress.enabled .Values.alertmanager.ingress.hosts }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ spec:
{{ toYaml .Values.prometheusOperator.admissionWebhooks.deployment.securityContext | indent 8 }}
{{- end }}
serviceAccountName: {{ template "kube-prometheus-stack.operator.serviceAccountName" . }}-webhook
automountServiceAccountToken: {{ .Values.prometheusOperator.admissionWebhooks.deployment.automountServiceAccountToken }}
{{- if .Values.prometheusOperator.admissionWebhooks.deployment.hostNetwork }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ spec:
{{ toYaml .Values.prometheusOperator.securityContext | indent 8 }}
{{- end }}
serviceAccountName: {{ template "kube-prometheus-stack.operator.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.prometheusOperator.automountServiceAccountToken }}
{{- if .Values.prometheusOperator.hostNetwork }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
namespace: {{ template "kube-prometheus-stack.namespace" . }}
labels:
{{- include "kube-prometheus-stack.prometheus-operator.labels" . | nindent 4 }}
automountServiceAccountToken: {{ .Values.prometheusOperator.serviceAccount.automountServiceAccountToken }}
{{- 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 @@ -13,6 +13,7 @@ metadata:
annotations:
{{ toYaml .Values.prometheus.serviceAccount.annotations | indent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.prometheus.serviceAccount.automountServiceAccountToken }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{ include "kube-prometheus-stack.imagePullSecrets" . | trim | indent 2 }}
Expand Down
14 changes: 14 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,10 @@ alertmanager:
##
secrets: []

## If false then the user will opt out of automounting API credentials.
##
automountServiceAccountToken: true

## ConfigMaps is a list of ConfigMaps in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods.
## The ConfigMaps are mounted into /etc/alertmanager/configmaps/.
##
Expand Down Expand Up @@ -2330,6 +2334,10 @@ prometheusOperator:
drop:
- ALL

## If false then the user will opt out of automounting API credentials.
##
automountServiceAccountToken: true

patch:
enabled: true
image:
Expand Down Expand Up @@ -2439,6 +2447,7 @@ prometheusOperator:
serviceAccount:
create: true
name: ""
automountServiceAccountToken: true

## Configuration for Prometheus operator service
##
Expand Down Expand Up @@ -2743,6 +2752,10 @@ prometheusOperator:
##
secretFieldSelector: "type!=kubernetes.io/dockercfg,type!=kubernetes.io/service-account-token,type!=helm.sh/release.v1"

## If false then the user will opt out of automounting API credentials.
##
automountServiceAccountToken: true

## Deploy a Prometheus instance
##
prometheus:
Expand Down Expand Up @@ -2788,6 +2801,7 @@ prometheus:
create: true
name: ""
annotations: {}
automountServiceAccountToken: true

# Service for thanos service discovery on sidecar
# Enable this can make Thanos Query can use
Expand Down

0 comments on commit 7569872

Please sign in to comment.