diff --git a/charts/podinfo/templates/_helpers.tpl b/charts/podinfo/templates/_helpers.tpl index c691994e8..8789ff889 100644 --- a/charts/podinfo/templates/_helpers.tpl +++ b/charts/podinfo/templates/_helpers.tpl @@ -36,10 +36,15 @@ Common labels {{- define "podinfo.labels" -}} helm.sh/chart: {{ include "podinfo.chart" . }} {{ include "podinfo.selectorLabels" . }} +app.kubernetes.io/instance: podinfo +app.kubernetes.io/part-of: podinfo {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.additionalLabels }} +{{ toYaml .Values.additionalLabels }} +{{- end }} {{- end }} {{/* diff --git a/charts/podinfo/templates/certificate.yaml b/charts/podinfo/templates/certificate.yaml index 8b2380925..3c7bc498f 100644 --- a/charts/podinfo/templates/certificate.yaml +++ b/charts/podinfo/templates/certificate.yaml @@ -5,6 +5,7 @@ metadata: name: {{ template "podinfo.fullname" . }} labels: {{- include "podinfo.labels" . | nindent 4 }} + app.kubernetes.io/component: certificate spec: dnsNames: {{- range .Values.certificate.dnsNames }} diff --git a/charts/podinfo/templates/deployment.yaml b/charts/podinfo/templates/deployment.yaml index 87ed37353..ebcbcc909 100644 --- a/charts/podinfo/templates/deployment.yaml +++ b/charts/podinfo/templates/deployment.yaml @@ -4,6 +4,7 @@ metadata: name: {{ template "podinfo.fullname" . }} labels: {{- include "podinfo.labels" . | nindent 4 }} + app.kubernetes.io/component: application spec: {{- if not .Values.hpa.enabled }} replicas: {{ .Values.replicaCount }} @@ -18,7 +19,8 @@ spec: template: metadata: labels: - {{- include "podinfo.selectorLabels" . | nindent 8 }} + {{- include "podinfo.labels" . | nindent 8 }} + app.kubernetes.io/component: application annotations: prometheus.io/scrape: "true" prometheus.io/port: "{{ .Values.service.httpPort }}" diff --git a/charts/podinfo/templates/hpa.yaml b/charts/podinfo/templates/hpa.yaml index 6d768ae01..e7103ef4c 100644 --- a/charts/podinfo/templates/hpa.yaml +++ b/charts/podinfo/templates/hpa.yaml @@ -4,7 +4,8 @@ kind: HorizontalPodAutoscaler metadata: name: {{ template "podinfo.fullname" . }} labels: - {{- include "podinfo.labels" . | nindent 4 }} + {{- include "podinfo.labels" . | nindent 4 }} + app.kubernetes.io/component: autoscaling spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/charts/podinfo/templates/ingress.yaml b/charts/podinfo/templates/ingress.yaml index bae38eb2c..3db244bcf 100644 --- a/charts/podinfo/templates/ingress.yaml +++ b/charts/podinfo/templates/ingress.yaml @@ -7,6 +7,7 @@ metadata: name: {{ $fullName }} labels: {{- include "podinfo.labels" . | nindent 4 }} + app.kubernetes.io/component: networking {{- with .Values.ingress.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/podinfo/templates/linkerd.yaml b/charts/podinfo/templates/linkerd.yaml index a96e0919b..b13717c3d 100644 --- a/charts/podinfo/templates/linkerd.yaml +++ b/charts/podinfo/templates/linkerd.yaml @@ -4,7 +4,8 @@ kind: ServiceProfile metadata: name: {{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local labels: - {{- include "podinfo.labels" . | nindent 4 }} + {{- include "podinfo.labels" . | nindent 4 }} + app.kubernetes.io/component: networking spec: routes: - condition: diff --git a/charts/podinfo/templates/service.yaml b/charts/podinfo/templates/service.yaml index 6014e7885..df19e5073 100644 --- a/charts/podinfo/templates/service.yaml +++ b/charts/podinfo/templates/service.yaml @@ -5,6 +5,7 @@ metadata: name: {{ template "podinfo.fullname" . }} labels: {{- include "podinfo.labels" . | nindent 4 }} + app.kubernetes.io/component: networking {{- with .Values.service.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/charts/podinfo/templates/serviceaccount.yaml b/charts/podinfo/templates/serviceaccount.yaml index 72ff524d2..e06732a0f 100644 --- a/charts/podinfo/templates/serviceaccount.yaml +++ b/charts/podinfo/templates/serviceaccount.yaml @@ -5,6 +5,7 @@ metadata: name: {{ template "podinfo.serviceAccountName" . }} labels: {{- include "podinfo.labels" . | nindent 4 }} + app.kubernetes.io/component: rbac {{- with .Values.serviceAccount.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 2 }} diff --git a/charts/podinfo/templates/servicemonitor.yaml b/charts/podinfo/templates/servicemonitor.yaml index fa0c34457..198748e75 100644 --- a/charts/podinfo/templates/servicemonitor.yaml +++ b/charts/podinfo/templates/servicemonitor.yaml @@ -5,6 +5,7 @@ metadata: name: {{ template "podinfo.fullname" . }} labels: {{- include "podinfo.labels" . | nindent 4 }} + app.kubernetes.io/component: metrics {{- with .Values.serviceMonitor.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/podinfo/values.yaml b/charts/podinfo/values.yaml index 6a4c42068..71e4bc155 100644 --- a/charts/podinfo/values.yaml +++ b/charts/podinfo/values.yaml @@ -16,6 +16,10 @@ ui: message: "" logo: "" +# -- Labels to be added to all other resources. +additionalLabels: {} + # app: podinfo + # failure conditions faults: delay: false