aboutsummaryrefslogtreecommitdiff
path: root/templates/_helpers.tpl
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-09-23 11:45:27 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-09-23 11:45:27 +0200
commitdbc36835a16f3c4f7e813a8a536c0922ef1f6bbd (patch)
treeabc402875944ec48a76bd62e1c35eddc9a469407 /templates/_helpers.tpl
parent258ae0c022e0c57e9e87c61e9ca5890ef0480da1 (diff)
Add labels template
Diffstat (limited to 'templates/_helpers.tpl')
-rw-r--r--templates/_helpers.tpl27
1 files changed, 27 insertions, 0 deletions
diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl
index 52158b7..638fade 100644
--- a/templates/_helpers.tpl
+++ b/templates/_helpers.tpl
@@ -14,3 +14,30 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "invidious.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "invidious.labels" -}}
+helm.sh/chart: {{ include "invidious.chart" . }}
+{{ include "invidious.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "invidious.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "invidious.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}