Skip to content

Commit

Permalink
[prometheus-adapter] Add automountServiceAccountToken flags (#4931)
Browse files Browse the repository at this point in the history
* add automountServiceAccountToken

Signed-off-by: dongjiang1989 <[email protected]>

* update version

Signed-off-by: dongjiang1989 <[email protected]>

* Update charts/prometheus-adapter/Chart.yaml

Signed-off-by: dongjiang <[email protected]>

---------

Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang <[email protected]>
  • Loading branch information
dongjiang1989 authored Mar 4, 2025
1 parent e1142fd commit 4abbdfc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/prometheus-adapter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: prometheus-adapter
version: 4.11.1
version: 4.12.0
appVersion: v0.12.0
description: A Helm chart for k8s prometheus adapter
home: https://github.com/kubernetes-sigs/prometheus-adapter
Expand Down
1 change: 1 addition & 0 deletions charts/prometheus-adapter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
serviceAccountName: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
{{- if .Values.hostNetwork.enabled }}
hostNetwork: true
Expand Down
1 change: 1 addition & 0 deletions charts/prometheus-adapter/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
metadata:
labels:
{{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
Expand Down
5 changes: 5 additions & 0 deletions charts/prometheus-adapter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ psp:
## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp
## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl

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

serviceAccount:
# Specifies whether a service account should be created
create: true
Expand All @@ -86,6 +89,8 @@ serviceAccount:
# Use case: AWS EKS IAM roles for service accounts
# ref: https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.html
annotations: {}
# If false then the user will opt out of automounting API credentials.
automountServiceAccountToken: true

# Custom DNS configuration to be added to prometheus-adapter pods
dnsConfig: {}
Expand Down

0 comments on commit 4abbdfc

Please sign in to comment.