diff --git a/cronjob/templates/serviceaccount.yaml b/cronjob/templates/serviceaccount.yaml index 4e41463..ea214ca 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 833d9e3..20c7449 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 diff --git a/simple/templates/serviceaccount.yaml b/simple/templates/serviceaccount.yaml index 3127bad..181cff8 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 95bce42..afd37be 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