From 562467765ad035c9032a257aef4c835754fb8e42 Mon Sep 17 00:00:00 2001 From: sayboras Date: Wed, 25 Mar 2020 16:30:10 +1100 Subject: [PATCH 1/2] Add annotations for service account --- charts/flagger/README.md | 3 +++ charts/flagger/templates/account.yaml | 4 ++++ charts/flagger/values.yaml | 2 ++ 3 files changed, 9 insertions(+) diff --git a/charts/flagger/README.md b/charts/flagger/README.md index ef0c9eaa..1ec23ac3 100644 --- a/charts/flagger/README.md +++ b/charts/flagger/README.md @@ -120,6 +120,9 @@ Parameter | Description | Default `podMonitor.podMonitor` | Additional labels to add to the PodMonitor | `{}` `leaderElection.enabled` | If `true`, Flagger will run in HA mode | `false` `leaderElection.replicaCount` | Number of replicas | `1` +`serviceAccount.create` | If `true`, Flagger will create service account | `true` +`serviceAccount.name` | The name of the service account to create or use | `""` +`serviceAccount.annotations` | Annotations for service account | `{}` `ingressAnnotationsPrefix` | Annotations prefix for ingresses | `custom.ingress.kubernetes.io` `rbac.create` | If `true`, create and use RBAC resources | `true` `rbac.pspEnabled` | If `true`, create and use a restricted pod security policy | `false` diff --git a/charts/flagger/templates/account.yaml b/charts/flagger/templates/account.yaml index b314ec21..16b87ac1 100644 --- a/charts/flagger/templates/account.yaml +++ b/charts/flagger/templates/account.yaml @@ -3,6 +3,10 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "flagger.serviceAccountName" . }} + annotations: + {{- if .Values.serviceAccount.annotations }} +{{ toYaml .Values.serviceAccount.annotations | indent 4 }} + {{- end }} labels: helm.sh/chart: {{ template "flagger.chart" . }} app.kubernetes.io/name: {{ template "flagger.name" . }} diff --git a/charts/flagger/values.yaml b/charts/flagger/values.yaml index 8f502041..e2a2bb11 100644 --- a/charts/flagger/values.yaml +++ b/charts/flagger/values.yaml @@ -76,6 +76,8 @@ serviceAccount: create: true # serviceAccount.name: The name of the service account to create or use name: "" + # serviceAccount.annotations: Annotations for service account + annotations: {} rbac: # rbac.create: `true` if rbac resources should be created From 99366b49608a6d80d4f8fa1651f628b86f921dd3 Mon Sep 17 00:00:00 2001 From: sayboras Date: Wed, 25 Mar 2020 16:37:38 +1100 Subject: [PATCH 2/2] Clarify more details for serviceAccount.name --- charts/flagger/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/flagger/README.md b/charts/flagger/README.md index 1ec23ac3..ab294f51 100644 --- a/charts/flagger/README.md +++ b/charts/flagger/README.md @@ -121,7 +121,7 @@ Parameter | Description | Default `leaderElection.enabled` | If `true`, Flagger will run in HA mode | `false` `leaderElection.replicaCount` | Number of replicas | `1` `serviceAccount.create` | If `true`, Flagger will create service account | `true` -`serviceAccount.name` | The name of the service account to create or use | `""` +`serviceAccount.name` | The name of the service account to create or use. If not set and `serviceAccount.create` is `true`, a name is generated using the Flagger fullname | `""` `serviceAccount.annotations` | Annotations for service account | `{}` `ingressAnnotationsPrefix` | Annotations prefix for ingresses | `custom.ingress.kubernetes.io` `rbac.create` | If `true`, create and use RBAC resources | `true`