Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Annotations on ServiceAccounts and Conditional Creation #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions charts/amazon-cloudwatch-observability/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/}}
Expand All @@ -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
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ kind: ServiceAccount
metadata:
name: {{ template "cloudwatch-agent.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
annotations:
{{- include "cloudwatch-agent.serviceAccountAnnotations" . | nindent 4}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{{- if .Values.manager.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
{{- 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 }}
1 change: 1 addition & 0 deletions charts/amazon-cloudwatch-observability/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
{
Expand Down