Helm chart for person-detection-app
Change-Id: I7069b65d6bcd3f2a722a294ff299ea8507b07261
diff --git a/apps/person-detection-app/templates/_helpers.tpl b/apps/person-detection-app/templates/_helpers.tpl
new file mode 100644
index 0000000..9b52287
--- /dev/null
+++ b/apps/person-detection-app/templates/_helpers.tpl
@@ -0,0 +1,67 @@
+{{/*
+Copyright 2020-present Open Networking Foundation
+SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "person-detection-app.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 "person-detection-app.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 "person-detection-app.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "person-detection-app.labels" -}}
+helm.sh/chart: {{ include "person-detection-app.chart" . }}
+{{ include "person-detection-app.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "person-detection-app.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "person-detection-app.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "person-detection-app.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (include "person-detection-app.fullname" .) .Values.serviceAccount.name }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.name }}
+{{- end }}
+{{- end }}