From 35417fa669babb20dcd8e35be1e6a9ed63426b66 Mon Sep 17 00:00:00 2001 From: Mike Kolesnik Date: Wed, 22 Jan 2020 16:50:32 +0200 Subject: [PATCH] Add globalnet service account creation Signed-off-by: Mike Kolesnik --- submariner/templates/_helpers.tpl | 13 ++++++++++++- submariner/templates/svc-acct.yaml | 14 +++++++++++++- submariner/values.yaml | 3 +++ 3 files changed, 28 insertions(+), 2 deletions(-) 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: ""