mirror of
https://github.com/truenas/charts.git
synced 2026-05-16 14:12:59 +08:00
Add common serviceaccount implementation
This commit is contained in:
11
library/common/templates/_serviceaccount.tpl
Normal file
11
library/common/templates/_serviceaccount.tpl
Normal 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 -}}
|
||||
@@ -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 -}}
|
||||
|
||||
Reference in New Issue
Block a user