diff --git a/charts/amazon-cloudwatch-observability/templates/_helpers.tpl b/charts/amazon-cloudwatch-observability/templates/_helpers.tpl index 60189e2f..fbdcf612 100644 --- a/charts/amazon-cloudwatch-observability/templates/_helpers.tpl +++ b/charts/amazon-cloudwatch-observability/templates/_helpers.tpl @@ -191,6 +191,15 @@ Create the name of the service account to use {{- end }} {{- end }} +{{/* +Set the Annotations for operator ServiceAccount +*/}} +{{- define "amazon-cloudwatch-observability.serviceAccountAnnotations" -}} +{{- if .Values.manager.serviceAccount.annotations }} +{{- .Values.manager.serviceAccount.annotations | toYaml }} +{{- end }} +{{- end }} + {{/* Create the name of the service account to use */}} @@ -202,6 +211,15 @@ Create the name of the service account to use {{- end }} {{- end }} +{{/* +Set the Annotations for cloudwatch-agent ServiceAccount +*/}} +{{- define "cloudwatch-agent.serviceAccountAnnotations" -}} +{{- if .Values.agent.serviceAccount.annotations }} +{{- .Values.agent.serviceAccount.annotations | toYaml }} +{{- end }} +{{- end }} + {{/* Create the name of the service account to use for dcgm exporter */}} diff --git a/charts/amazon-cloudwatch-observability/templates/cloudwatch-agent-serviceaccount.yaml b/charts/amazon-cloudwatch-observability/templates/cloudwatch-agent-serviceaccount.yaml index 41b0083b..914107dc 100644 --- a/charts/amazon-cloudwatch-observability/templates/cloudwatch-agent-serviceaccount.yaml +++ b/charts/amazon-cloudwatch-observability/templates/cloudwatch-agent-serviceaccount.yaml @@ -4,4 +4,6 @@ kind: ServiceAccount metadata: name: {{ template "cloudwatch-agent.serviceAccountName" . }} namespace: {{ .Release.Namespace }} + annotations: + {{- include "cloudwatch-agent.serviceAccountAnnotations" . | nindent 4}} {{- end }} diff --git a/charts/amazon-cloudwatch-observability/templates/operator-serviceaccount.yaml b/charts/amazon-cloudwatch-observability/templates/operator-serviceaccount.yaml index 6c81353e..dd7550de 100644 --- a/charts/amazon-cloudwatch-observability/templates/operator-serviceaccount.yaml +++ b/charts/amazon-cloudwatch-observability/templates/operator-serviceaccount.yaml @@ -1,3 +1,4 @@ +{{- if .Values.manager.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: @@ -5,3 +6,6 @@ metadata: {{- include "amazon-cloudwatch-observability.labels" . | nindent 4}} name: {{ template "amazon-cloudwatch-observability.managerServiceAccountName" . }} namespace: {{ .Release.Namespace }} + annotations: + {{- include "amazon-cloudwatch-observability.serviceAccountAnnotations" . | nindent 4}} +{{- end }} diff --git a/charts/amazon-cloudwatch-observability/values.yaml b/charts/amazon-cloudwatch-observability/values.yaml index 826d3423..c5244d48 100644 --- a/charts/amazon-cloudwatch-observability/values.yaml +++ b/charts/amazon-cloudwatch-observability/values.yaml @@ -547,6 +547,7 @@ agent: issuerAnnotations: { } serviceAccount: name: # override agent service account name + annotations: { } # optional annotations for the service account config: # optional config that can be provided to override the defaultConfig defaultConfig: {