From 9213f0d1f52baca21578e18428bc95f2f7f83720 Mon Sep 17 00:00:00 2001 From: Starefossen Date: Mon, 1 Mar 2021 20:20:55 +0800 Subject: [PATCH] Add `app` and `version` labels (#121) This pull request adds the `app` and `version` labels that are used by Istio. > Pods with app and version labels: We recommend adding an explicit app label and version label to the specification of the pods deployed using a Kubernetes Deployment. The app and version labels add contextual information to the metrics and telemetry that Istio collects. > > * The app label: Each deployment should have a distinct app label with a meaningful value. The app label is used to add contextual information in distributed tracing. > > * The version label: This label indicates the version of the application corresponding to the particular deployment. From https://istio.io/latest/docs/ops/deployment/requirements/#pod-requirements Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/121 Reviewed-by: luhahn Reviewed-by: lafriks Co-authored-by: Starefossen Co-committed-by: Starefossen --- templates/_helpers.tpl | 2 ++ templates/gitea/statefulset.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 0cf3021..04fd352 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -36,9 +36,11 @@ Common labels */}} {{- define "gitea.labels" -}} helm.sh/chart: {{ include "gitea.chart" . }} +app: {{ include "gitea.name" . }} {{ include "gitea.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} diff --git a/templates/gitea/statefulset.yaml b/templates/gitea/statefulset.yaml index 13ee503..1415da6 100644 --- a/templates/gitea/statefulset.yaml +++ b/templates/gitea/statefulset.yaml @@ -19,7 +19,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "gitea.selectorLabels" . | nindent 8 }} + {{- include "gitea.labels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: