Add common serviceaccount implementation

This commit is contained in:
Waqar Ahmed
2021-01-29 23:15:28 +05:00
parent e5d0fb7cc6
commit 7a51a9ad40
2 changed files with 18 additions and 0 deletions

View File

@@ -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 -}}

View File

@@ -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 -}}