diff --git a/submariner/templates/_helpers.tpl b/submariner/templates/_helpers.tpl index 30808f6..6c860bd 100644 --- a/submariner/templates/_helpers.tpl +++ b/submariner/templates/_helpers.tpl @@ -51,4 +51,15 @@ Create the name of the submariner-route-agent service account to use {{- else -}} {{ default "default" .Values.serviceAccounts.routeAgent.name }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Create the name of the submariner-globalnet service account to use +*/}} +{{- define "submariner.globalnetServiceAccountName" -}} +{{- if .Values.serviceAccounts.globalnet.create -}} + {{ default (printf "%s-globalnet" (include "submariner.fullname" .)) .Values.serviceAccounts.globalnet.name }} +{{- else -}} + {{ default "default" .Values.serviceAccounts.globalnet.name }} +{{- end -}} +{{- end -}} diff --git a/submariner/templates/svc-acct.yaml b/submariner/templates/svc-acct.yaml index d433db2..4b819cf 100644 --- a/submariner/templates/svc-acct.yaml +++ b/submariner/templates/svc-acct.yaml @@ -20,4 +20,16 @@ metadata: release: {{ .Release.Name | quote }} chart: {{ template "submariner.chart" . }} app: {{ template "submariner.name" . }} -{{- end }} \ No newline at end of file +{{- end }} +--- +{{- if .Values.serviceAccounts.globalnet.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "submariner.globalnetServiceAccountName" . }} + labels: + heritage: {{ .Release.Service | quote }} + release: {{ .Release.Name | quote }} + chart: {{ template "submariner.chart" . }} + app: {{ template "submariner.name" . }} +{{- end }} diff --git a/submariner/values.yaml b/submariner/values.yaml index e0ba61e..1d1274f 100644 --- a/submariner/values.yaml +++ b/submariner/values.yaml @@ -56,3 +56,6 @@ serviceAccounts: routeAgent: create: true name: "" + globalnet: + create: false + name: ""