Forráskód Böngészése

Add common serviceaccount implementation

Waqar Ahmed 4 éve
szülő
commit
7a51a9ad40

+ 11 - 0
library/common/templates/_serviceaccount.tpl

@@ -0,0 +1,11 @@
+{{-/*
+Common service account
+*/-}}
+{{- define "common.serviceaccount" -}}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: {{ include "common.names.serviceAccountName" . | quote }}
+  namespace: {{ .Release.Namespace | quote }}
+  labels: {{- include "common.labels.selectorLabels" | nindent 4 -}}
+{{- end -}}

+ 7 - 0
library/common/templates/lib/chart/_names.tpl

@@ -29,3 +29,10 @@ Create chart name and version as used by the chart label.
 {{- define "common.names.chart" -}}
 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
 {{- end }}
+
+{{/*
+Determine service account name for deployment or statefulset.
+*/}}
+{{- define "common.names.serviceAccountName" -}}
+{{- (include "common.names.fullname" .) | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}