From 0ca279ca8f97446e4f3473fa4c6daf18501ce843 Mon Sep 17 00:00:00 2001 From: Raj Nishtala <113392743+rnishtala-sumo@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:45:38 -0400 Subject: [PATCH] Add new service account for the otel cloudwatch collector statefulset (#3374) --- .changelog/3374.added.txt | 1 + .../sumologic/templates/_helpers/_logs.tpl | 4 ++++ .../otelcol-cloudwatch/serviceaccount.yaml | 18 ++++++++++++++++++ .../otelcol-cloudwatch/statefulset.yaml | 2 +- 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .changelog/3374.added.txt create mode 100644 deploy/helm/sumologic/templates/logs/collector/otelcol-cloudwatch/serviceaccount.yaml diff --git a/.changelog/3374.added.txt b/.changelog/3374.added.txt new file mode 100644 index 0000000000..c23479ff8a --- /dev/null +++ b/.changelog/3374.added.txt @@ -0,0 +1 @@ +Add new service account for the otel cloudwatch collector statefulset \ No newline at end of file diff --git a/deploy/helm/sumologic/templates/_helpers/_logs.tpl b/deploy/helm/sumologic/templates/_helpers/_logs.tpl index 9489e6f441..b5fbd5b8a0 100644 --- a/deploy/helm/sumologic/templates/_helpers/_logs.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_logs.tpl @@ -119,6 +119,10 @@ Return the exporters for kubelet log pipeline. {{- template "sumologic.metadata.name.logs.collector" . }} {{- end -}} +{{- define "sumologic.metadata.name.logs.collector.cloudwatch.serviceaccount" -}} +{{- template "sumologic.metadata.name.logs.collector" . }} +{{- end -}} + {{- define "sumologic.metadata.name.logs.collector.daemonset" -}} {{- template "sumologic.metadata.name.logs.collector" . }} {{- end -}} diff --git a/deploy/helm/sumologic/templates/logs/collector/otelcol-cloudwatch/serviceaccount.yaml b/deploy/helm/sumologic/templates/logs/collector/otelcol-cloudwatch/serviceaccount.yaml new file mode 100644 index 0000000000..996c1acbfa --- /dev/null +++ b/deploy/helm/sumologic/templates/logs/collector/otelcol-cloudwatch/serviceaccount.yaml @@ -0,0 +1,18 @@ +{{- if .Values.sumologic.logs.collector.otelcloudwatch.enabled }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "sumologic.metadata.name.logs.collector.cloudwatch.serviceaccount" . }} + namespace: {{ template "sumologic.namespace" . }} + labels: + app: {{ template "sumologic.metadata.name.logs.collector.cloudwatch.serviceaccount" . }} + {{- include "sumologic.labels.common" . | nindent 4 }} +{{- if and .Values.sumologic.logs.collector.otelcloudwatch.enabled .Values.sumologic.logs.collector.otelcloudwatch.roleArn}} + annotations: + eks.amazonaws.com/role-arn: {{ .Values.sumologic.logs.collector.otelcloudwatch.roleArn }} +{{- end }} +{{- if .Values.sumologic.pullSecrets }} +imagePullSecrets: +{{ toYaml .Values.sumologic.pullSecrets | indent 2 }} +{{- end }} +{{- end }} diff --git a/deploy/helm/sumologic/templates/logs/collector/otelcol-cloudwatch/statefulset.yaml b/deploy/helm/sumologic/templates/logs/collector/otelcol-cloudwatch/statefulset.yaml index a39dcda64a..785d1b193a 100644 --- a/deploy/helm/sumologic/templates/logs/collector/otelcol-cloudwatch/statefulset.yaml +++ b/deploy/helm/sumologic/templates/logs/collector/otelcol-cloudwatch/statefulset.yaml @@ -32,7 +32,7 @@ spec: {{ toYaml .Values.otelcloudwatch.statefulset.podLabels | indent 8 }} {{- end }} spec: - serviceAccountName: {{ template "sumologic.metadata.name.logs.collector.serviceaccount" . }} + serviceAccountName: {{ template "sumologic.metadata.name.logs.collector.cloudwatch.serviceaccount" . }} {{- if .Values.otelcloudwatch.statefulset.nodeSelector }} nodeSelector: {{ toYaml .Values.otelcloudwatch.statefulset.nodeSelector | indent 8 }}