diff options
author | Todd Malsbary <todd.malsbary@intel.com> | 2021-03-01 14:02:16 -0800 |
---|---|---|
committer | Todd Malsbary <todd.malsbary@intel.com> | 2021-04-09 10:21:49 -0700 |
commit | dc230e023a3149ae9f6dc023eb40e12b97ddb023 (patch) | |
tree | 3218e6fca169c3231d66420fa8474b1e2edd7365 /kud/deployment_infra/helm/multus-cni/templates/_helpers.tpl | |
parent | e9a12efd25a570e64b728d8fc482939a727e9214 (diff) |
Add multus addon helm chart
- Support for calico configuration is present but currently disabled.
Issue-ID: MULTICLOUD-1324
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I2d2161564c4da2e165e5cf13cea92fae4935f8b2
Diffstat (limited to 'kud/deployment_infra/helm/multus-cni/templates/_helpers.tpl')
-rw-r--r-- | kud/deployment_infra/helm/multus-cni/templates/_helpers.tpl | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/kud/deployment_infra/helm/multus-cni/templates/_helpers.tpl b/kud/deployment_infra/helm/multus-cni/templates/_helpers.tpl new file mode 100644 index 00000000..71aee739 --- /dev/null +++ b/kud/deployment_infra/helm/multus-cni/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "multus.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 "multus.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 chart name and version as used by the chart label. +*/}} +{{- define "multus.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "multus.labels" -}} +helm.sh/chart: {{ include "multus.chart" . }} +{{ include "multus.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "multus.selectorLabels" -}} +app.kubernetes.io/name: {{ include "multus.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "multus.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "multus.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} |