aboutsummaryrefslogtreecommitdiffstats
path: root/kud/deployment_infra/helm/qat-device-plugin/templates/_helpers.tpl
diff options
context:
space:
mode:
authorTodd Malsbary <todd.malsbary@intel.com>2021-03-24 16:02:08 -0700
committerTodd Malsbary <todd.malsbary@intel.com>2021-05-05 16:50:07 -0700
commitbe23566cec4b5571178a930a5a16d22be9dd7b93 (patch)
tree7092e4417be80469c8b9de14400500e83503e1f2 /kud/deployment_infra/helm/qat-device-plugin/templates/_helpers.tpl
parent996bd19026a18aac190f76bd137de27a3be6d200 (diff)
Add qat addon helm chart
This chart contains the upstream qat plugin from intel-device-plugins-for-kubernetes together with a qat driver installer. Issue-ID: MULTICLOUD-1324 Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> Change-Id: I3467ba204276999dac4087bdf68ac0d4439861ad
Diffstat (limited to 'kud/deployment_infra/helm/qat-device-plugin/templates/_helpers.tpl')
-rw-r--r--kud/deployment_infra/helm/qat-device-plugin/templates/_helpers.tpl52
1 files changed, 52 insertions, 0 deletions
diff --git a/kud/deployment_infra/helm/qat-device-plugin/templates/_helpers.tpl b/kud/deployment_infra/helm/qat-device-plugin/templates/_helpers.tpl
new file mode 100644
index 00000000..77889d5d
--- /dev/null
+++ b/kud/deployment_infra/helm/qat-device-plugin/templates/_helpers.tpl
@@ -0,0 +1,52 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "qat-device-plugin.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 "qat-device-plugin.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 "qat-device-plugin.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Common labels
+*/}}
+{{- define "qat-device-plugin.labels" -}}
+helm.sh/chart: {{ include "qat-device-plugin.chart" . }}
+{{ include "qat-device-plugin.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end -}}
+
+{{/*
+Selector labels
+*/}}
+{{- define "qat-device-plugin.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "qat-device-plugin.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end -}}