From 7d4e42eff67f3a555b6b30b8cff6542345835344 Mon Sep 17 00:00:00 2001 From: Fredrik Wendel Date: Thu, 4 Jul 2024 07:32:48 +0200 Subject: [PATCH] Allow adding annotations on the ServiceAccount Allow specifying annotations that will be added to the ServiceAccount. This fixes jcmoraisjr/haproxy-ingress/issues/1056. --- haproxy-ingress/README.md | 1 + haproxy-ingress/templates/serviceaccount.yaml | 4 ++++ haproxy-ingress/values.yaml | 3 +++ 3 files changed, 8 insertions(+) diff --git a/haproxy-ingress/README.md b/haproxy-ingress/README.md index c8517fc..86a5b73 100644 --- a/haproxy-ingress/README.md +++ b/haproxy-ingress/README.md @@ -99,6 +99,7 @@ Parameter | Description | Default `serviceAccount.create` | If true, create serviceAccount | `true` `serviceAccount.name` | ServiceAccount to be used | `` `serviceAccount.automountServiceAccountToken` | Automount API credentials for the ServiceAccount | `true` | +`serviceAccount.annotations` | A list of annotations to add to the ServiceAccount | `` `controller.automountServiceAccountToken` | Automount API credentials to the controller's pod | `true` | `controller.name` | name of the controller component | `controller` `controller.image.registry` | controller container image registry | `quay.io` diff --git a/haproxy-ingress/templates/serviceaccount.yaml b/haproxy-ingress/templates/serviceaccount.yaml index 7824626..0895f60 100644 --- a/haproxy-ingress/templates/serviceaccount.yaml +++ b/haproxy-ingress/templates/serviceaccount.yaml @@ -9,4 +9,8 @@ metadata: {{- include "haproxy-ingress.labels" . | nindent 4 }} name: {{ include "haproxy-ingress.serviceAccountName" . }} namespace: {{ .Release.Namespace }} +{{- if .Values.serviceAccount.annotations }} + annotations: + {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} +{{- end }} {{- end }} diff --git a/haproxy-ingress/values.yaml b/haproxy-ingress/values.yaml index 46f6746..04461f0 100644 --- a/haproxy-ingress/values.yaml +++ b/haproxy-ingress/values.yaml @@ -10,6 +10,9 @@ rbac: # Create ServiceAccount serviceAccount: + # Annotations to be added to the ServiceAccount + annotations: {} + # - eks.amazonaws.com/role-arn: "arn:aws:iam::111111111111:role/some-role-name" # Specifies whether a ServiceAccount should be created create: true # The name of the ServiceAccount to use.