From fb9f2c4f98c392bb4c9b5bcbcfb01347b26f56cb Mon Sep 17 00:00:00 2001 From: Juan Pablo Jaramillo Pineda Date: Sun, 2 Aug 2020 05:31:40 -0500 Subject: [PATCH] [stable/kube-state-metrics] Add annotations for serviceAccount (#23411) Signed-off-by: Juan Pablo Jaramillo Pineda --- stable/kube-state-metrics/Chart.yaml | 2 +- stable/kube-state-metrics/README.md | 1 + stable/kube-state-metrics/templates/serviceaccount.yaml | 4 ++++ stable/kube-state-metrics/values.yaml | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/stable/kube-state-metrics/Chart.yaml b/stable/kube-state-metrics/Chart.yaml index 0e9ebb2665..5554d87c39 100644 --- a/stable/kube-state-metrics/Chart.yaml +++ b/stable/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.13 +version: 2.8.14 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/stable/kube-state-metrics/README.md b/stable/kube-state-metrics/README.md index 7d5cee5259..8a27b554d4 100644 --- a/stable/kube-state-metrics/README.md +++ b/stable/kube-state-metrics/README.md @@ -29,6 +29,7 @@ $ helm install stable/kube-state-metrics | `serviceAccount.create` | If true, create & use serviceAccount | `true` | | `serviceAccount.name` | If not set & create is true, use template fullname | | | `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | +| `serviceAccount.annotations` | Annotations to be added to the serviceAccount | `{}` | | `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources. Note that related RBACs are created only if `rbac.enabled` is `true`. | `false` | | `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | `{}` | | `podSecurityPolicy.additionalVolumes` | Specify allowed volumes in the pod security policy (`secret` is always allowed) | `[]` | diff --git a/stable/kube-state-metrics/templates/serviceaccount.yaml b/stable/kube-state-metrics/templates/serviceaccount.yaml index 32bb1640f2..2e8a1ee38f 100644 --- a/stable/kube-state-metrics/templates/serviceaccount.yaml +++ b/stable/kube-state-metrics/templates/serviceaccount.yaml @@ -9,6 +9,10 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} namespace: {{ template "kube-state-metrics.namespace" . }} +{{- if .Values.serviceAccount.annotations }} + annotations: +{{ toYaml .Values.serviceAccount.annotations | indent 4 }} +{{- end }} imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} {{- end -}} diff --git a/stable/kube-state-metrics/values.yaml b/stable/kube-state-metrics/values.yaml index 08d0435628..92de8e22da 100644 --- a/stable/kube-state-metrics/values.yaml +++ b/stable/kube-state-metrics/values.yaml @@ -42,6 +42,10 @@ serviceAccount: # Reference to one or more secrets to be used when pulling images # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ imagePullSecrets: [] + # ServiceAccount annotations. + # Use case: AWS EKS IAM roles for service accounts + # ref: https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.html + annotations: {} prometheus: monitor: