From aa5c19a1c440bb8b969204902ef461d60fc2def7 Mon Sep 17 00:00:00 2001 From: Hyeonseop Lee Date: Sat, 21 Mar 2020 01:08:37 +0900 Subject: [PATCH] [stable/prometheus] Make service account annotations configurable (#21537) This change makes the annotations for service accounts configurable. This change is useful when you need to set specific annotations to service accounts, for example when using IAM Roles for service accounts in AWS EKS. Signed-off-by: Hyeonseop Lee --- stable/prometheus/Chart.yaml | 2 +- stable/prometheus/README.md | 4 ++++ stable/prometheus/templates/alertmanager-serviceaccount.yaml | 2 ++ stable/prometheus/templates/node-exporter-serviceaccount.yaml | 2 ++ stable/prometheus/templates/pushgateway-serviceaccount.yaml | 2 ++ stable/prometheus/templates/server-serviceaccount.yaml | 2 ++ stable/prometheus/values.yaml | 4 ++++ 7 files changed, 17 insertions(+), 1 deletion(-) diff --git a/stable/prometheus/Chart.yaml b/stable/prometheus/Chart.yaml index 963d7fc97d..1401e26f37 100644 --- a/stable/prometheus/Chart.yaml +++ b/stable/prometheus/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: prometheus -version: 11.0.2 +version: 11.0.3 appVersion: 2.16.0 description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ diff --git a/stable/prometheus/README.md b/stable/prometheus/README.md index dc32dcd15a..5805941bb2 100644 --- a/stable/prometheus/README.md +++ b/stable/prometheus/README.md @@ -354,14 +354,18 @@ Parameter | Description | Default `server.strategy` | Deployment strategy | `{ "type": "RollingUpdate" }` `serviceAccounts.alertmanager.create` | If true, create the alertmanager service account | `true` `serviceAccounts.alertmanager.name` | name of the alertmanager service account to use or create | `{{ prometheus.alertmanager.fullname }}` +`serviceAccounts.alertmanager.annotations` | annotations for the alertmanager service account | `{}` `serviceAccounts.kubeStateMetrics.create` | If true, create the kubeStateMetrics service account | `true` `serviceAccounts.kubeStateMetrics.name` | name of the kubeStateMetrics service account to use or create | `{{ prometheus.kubeStateMetrics.fullname }}` `serviceAccounts.nodeExporter.create` | If true, create the nodeExporter service account | `true` `serviceAccounts.nodeExporter.name` | name of the nodeExporter service account to use or create | `{{ prometheus.nodeExporter.fullname }}` +`serviceAccounts.nodeExporter.annotations` | annotations for the nodeExporter service account | `{}` `serviceAccounts.pushgateway.create` | If true, create the pushgateway service account | `true` `serviceAccounts.pushgateway.name` | name of the pushgateway service account to use or create | `{{ prometheus.pushgateway.fullname }}` +`serviceAccounts.pushgateway.annotations` | annotations for the pushgateway service account | `{}` `serviceAccounts.server.create` | If true, create the server service account | `true` `serviceAccounts.server.name` | name of the server service account to use or create | `{{ prometheus.server.fullname }}` +`serviceAccounts.server.annotations` | annotations for the server service account | `{}` `server.terminationGracePeriodSeconds` | Prometheus server Pod termination grace period | `300` `server.retention` | (optional) Prometheus data retention | `"15d"` `serverFiles.alerts` | (Deprecated) Prometheus server alerts configuration | `{}` diff --git a/stable/prometheus/templates/alertmanager-serviceaccount.yaml b/stable/prometheus/templates/alertmanager-serviceaccount.yaml index 4ff4558963..d23fcb8d99 100644 --- a/stable/prometheus/templates/alertmanager-serviceaccount.yaml +++ b/stable/prometheus/templates/alertmanager-serviceaccount.yaml @@ -5,4 +5,6 @@ metadata: labels: {{- include "prometheus.alertmanager.labels" . | nindent 4 }} name: {{ template "prometheus.serviceAccountName.alertmanager" . }} + annotations: +{{ toYaml .Values.serviceAccounts.alertmanager.annotations | indent 4 }} {{- end -}} diff --git a/stable/prometheus/templates/node-exporter-serviceaccount.yaml b/stable/prometheus/templates/node-exporter-serviceaccount.yaml index a922b238bf..ee4d6607bf 100644 --- a/stable/prometheus/templates/node-exporter-serviceaccount.yaml +++ b/stable/prometheus/templates/node-exporter-serviceaccount.yaml @@ -5,4 +5,6 @@ metadata: labels: {{- include "prometheus.nodeExporter.labels" . | nindent 4 }} name: {{ template "prometheus.serviceAccountName.nodeExporter" . }} + annotations: +{{ toYaml .Values.serviceAccounts.nodeExporter.annotations | indent 4 }} {{- end -}} diff --git a/stable/prometheus/templates/pushgateway-serviceaccount.yaml b/stable/prometheus/templates/pushgateway-serviceaccount.yaml index 1596a28f9c..2049c30e91 100644 --- a/stable/prometheus/templates/pushgateway-serviceaccount.yaml +++ b/stable/prometheus/templates/pushgateway-serviceaccount.yaml @@ -5,4 +5,6 @@ metadata: labels: {{- include "prometheus.pushgateway.labels" . | nindent 4 }} name: {{ template "prometheus.serviceAccountName.pushgateway" . }} + annotations: +{{ toYaml .Values.serviceAccounts.pushgateway.annotations | indent 4 }} {{- end -}} diff --git a/stable/prometheus/templates/server-serviceaccount.yaml b/stable/prometheus/templates/server-serviceaccount.yaml index 68c64121aa..9ca20b2905 100644 --- a/stable/prometheus/templates/server-serviceaccount.yaml +++ b/stable/prometheus/templates/server-serviceaccount.yaml @@ -6,5 +6,7 @@ metadata: labels: {{- include "prometheus.server.labels" . | nindent 4 }} name: {{ template "prometheus.serviceAccountName.server" . }} + annotations: +{{ toYaml .Values.serviceAccounts.server.annotations | indent 4 }} {{- end }} {{- end }} diff --git a/stable/prometheus/values.yaml b/stable/prometheus/values.yaml index a95df0406c..5b3998c848 100644 --- a/stable/prometheus/values.yaml +++ b/stable/prometheus/values.yaml @@ -13,15 +13,19 @@ serviceAccounts: alertmanager: create: true name: + annotations: {} nodeExporter: create: true name: + annotations: {} pushgateway: create: true name: + annotations: {} server: create: true name: + annotations: {} alertmanager: ## If false, alertmanager will not be installed