From f3439fc7c1282b5cad6d1acb1492a96fbc42c00b Mon Sep 17 00:00:00 2001 From: Xin Date: Tue, 30 Jan 2024 14:35:13 +0800 Subject: [PATCH 1/2] feat(simple): allow skip creating serviceaccount --- simple/templates/serviceaccount.yaml | 6 ++++++ simple/values.yaml | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/simple/templates/serviceaccount.yaml b/simple/templates/serviceaccount.yaml index 3127bade..181cff85 100644 --- a/simple/templates/serviceaccount.yaml +++ b/simple/templates/serviceaccount.yaml @@ -1,7 +1,13 @@ {{- if .Values.serviceaccount }} +{{- if .Values.serviceaccount.skipCreation }} +{{- /* +Skip create service account +*/}} +{{- else}} apiVersion: v1 kind: ServiceAccount metadata: annotations: {{ toYaml .Values.serviceaccount.annotations | nindent 4}} name: {{ .Values.serviceaccount.name | default (printf "%s-pod-service-account" .Values.name) }} {{- end}} +{{- end}} diff --git a/simple/values.yaml b/simple/values.yaml index 95bce42b..afd37be4 100644 --- a/simple/values.yaml +++ b/simple/values.yaml @@ -336,4 +336,13 @@ analyses: {} # )) / # sum(irate( # istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}"}[5m] -# )) \ No newline at end of file +# )) + +# Service account is used by pod. For more details on fields "serviceaccount", please have a look on ./simple/templates/serviceaccount.yaml +serviceaccount: {} +# example +# serviceaccount: +# annotations: +# eks.amazonaws.com/role-arn: +# name: +# skipCreation: false \ No newline at end of file From 74de727904e369ceb3e7924e3cf087e50c86e1f2 Mon Sep 17 00:00:00 2001 From: Xin Date: Tue, 30 Jan 2024 14:35:24 +0800 Subject: [PATCH 2/2] feat(cronjob): allow skip creating serviceaccount --- cronjob/templates/serviceaccount.yaml | 6 ++++++ cronjob/values.yaml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/cronjob/templates/serviceaccount.yaml b/cronjob/templates/serviceaccount.yaml index 4e414637..ea214ca2 100644 --- a/cronjob/templates/serviceaccount.yaml +++ b/cronjob/templates/serviceaccount.yaml @@ -1,9 +1,15 @@ {{- if .Values.serviceaccount }} +{{- if .Values.serviceaccount.skipCreation }} +{{- /* +Skip create service account +*/}} +{{- else}} apiVersion: v1 kind: ServiceAccount metadata: annotations: {{ toYaml .Values.serviceaccount.annotations | nindent 4}} name: {{ .Values.serviceaccount.name | default (printf "%s-pod-service-account" .Values.name) }} +{{- end}} {{- else if .Values.serviceAccount }} apiVersion: v1 kind: ServiceAccount diff --git a/cronjob/values.yaml b/cronjob/values.yaml index 833d9e34..20c74497 100644 --- a/cronjob/values.yaml +++ b/cronjob/values.yaml @@ -140,12 +140,14 @@ envFrom: {} # - test-2-secret # Service account is used by pod. For more details on fields "serviceaccount" and "serviceAccount", please have a look on ./cronjob/templates/serviceaccount.yaml +# "serviceAccount" is deprecated, please use "serviceaccount" instead. serviceaccount: {} # example # serviceaccount: # annotations: # eks.amazonaws.com/role-arn: # name: +# skipCreation: false # This can be used to suspend the cron workflow by default, set this to true to suspend the cron workflow by default suspend: false