120 lines
3.5 KiB
Smarty
120 lines
3.5 KiB
Smarty
{{/* vim: set filetype=mustache: */}}
|
|
|
|
{{/*
|
|
Expand the name of the chart.
|
|
*/}}
|
|
{{- define "nginx-ingress.name" -}}
|
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Create a default fully qualified app name.
|
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
If release name contains chart name it will be used as a full name.
|
|
*/}}
|
|
{{- define "nginx-ingress.fullname" -}}
|
|
{{- if .Values.fullnameOverride }}
|
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
|
{{- else }}
|
|
{{- $name := default .Chart.Name .Values.nameOverride }}
|
|
{{- if contains $name .Release.Name }}
|
|
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
|
{{- else }}
|
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Create a default fully qualified controller name.
|
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
*/}}
|
|
{{- define "nginx-ingress.controller.fullname" -}}
|
|
{{- printf "%s-%s" (include "nginx-ingress.fullname" .) .Values.controller.name | trunc 63 | trimSuffix "-" -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Create chart name and version as used by the chart label.
|
|
*/}}
|
|
{{- define "nginx-ingress.chart" -}}
|
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Common labels
|
|
*/}}
|
|
{{- define "nginx-ingress.labels" -}}
|
|
helm.sh/chart: {{ include "nginx-ingress.chart" . }}
|
|
{{ include "nginx-ingress.selectorLabels" . }}
|
|
{{- if .Chart.AppVersion }}
|
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
{{- end }}
|
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Selector labels
|
|
*/}}
|
|
{{- define "nginx-ingress.selectorLabels" -}}
|
|
app.kubernetes.io/name: {{ include "nginx-ingress.name" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Expand the name of the configmap.
|
|
*/}}
|
|
{{- define "nginx-ingress.configName" -}}
|
|
{{- if .Values.controller.customConfigMap -}}
|
|
{{ .Values.controller.customConfigMap }}
|
|
{{- else -}}
|
|
{{- default (include "nginx-ingress.fullname" .) .Values.controller.config.name -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Expand leader election lock name.
|
|
*/}}
|
|
{{- define "nginx-ingress.leaderElectionName" -}}
|
|
{{- if .Values.controller.reportIngressStatus.leaderElectionLockName -}}
|
|
{{ .Values.controller.reportIngressStatus.leaderElectionLockName }}
|
|
{{- else -}}
|
|
{{- printf "%s-%s" (include "nginx-ingress.fullname" .) "leader-election" -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Expand service account name.
|
|
*/}}
|
|
{{- define "nginx-ingress.serviceAccountName" -}}
|
|
{{- default (include "nginx-ingress.fullname" .) .Values.controller.serviceAccount.name -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Expand default TLS name.
|
|
*/}}
|
|
{{- define "nginx-ingress.defaultTLSName" -}}
|
|
{{- printf "%s-%s" (include "nginx-ingress.fullname" .) "default-server-tls" -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Expand wildcard TLS name.
|
|
*/}}
|
|
{{- define "nginx-ingress.wildcardTLSName" -}}
|
|
{{- printf "%s-%s" (include "nginx-ingress.fullname" .) "wildcard-tls" -}}
|
|
{{- end -}}
|
|
|
|
{{- define "nginx-ingress.tag" -}}
|
|
{{- default .Chart.AppVersion .Values.controller.image.tag -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Expand image name.
|
|
*/}}
|
|
{{- define "nginx-ingress.image" -}}
|
|
{{- if .Values.controller.image.digest -}}
|
|
{{- printf "%s@%s" .Values.controller.image.repository .Values.controller.image.digest -}}
|
|
{{- else -}}
|
|
{{- printf "%s:%s" .Values.controller.image.repository (include "nginx-ingress.tag" .) -}}
|
|
{{- end -}}
|
|
{{- end -}}
|