diff --git a/cmd/helm/testdata/testcharts/alpine/templates/alpine-pod.yaml b/cmd/helm/testdata/testcharts/alpine/templates/alpine-pod.yaml index 001c2cbbd..b48bb5e4f 100644 --- a/cmd/helm/testdata/testcharts/alpine/templates/alpine-pod.yaml +++ b/cmd/helm/testdata/testcharts/alpine/templates/alpine-pod.yaml @@ -10,6 +10,7 @@ metadata: # The "release" convention makes it easy to tie a release to all of the # Kubernetes resources that were created as part of that release. app.kubernetes.io/instance: {{.Release.Name | quote }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} # This makes it easy to audit chart usage. helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" values: {{.Values.test.Name}} diff --git a/cmd/helm/testdata/testcharts/chart-bad-type/templates/alpine-pod.yaml b/cmd/helm/testdata/testcharts/chart-bad-type/templates/alpine-pod.yaml index ee61f2056..297d9a019 100644 --- a/cmd/helm/testdata/testcharts/chart-bad-type/templates/alpine-pod.yaml +++ b/cmd/helm/testdata/testcharts/chart-bad-type/templates/alpine-pod.yaml @@ -9,7 +9,8 @@ metadata: heritage: {{.Release.Service | quote }} # The "release" convention makes it easy to tie a release to all of the # Kubernetes resources that were created as part of that release. - release: {{.Release.Name | quote }} + app.kubernetes.io/instance: {{.Release.Name | quote }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} # This makes it easy to audit chart usage. chart: "{{.Chart.Name}}-{{.Chart.Version}}" values: {{.Values.test.Name}} diff --git a/cmd/helm/testdata/testcharts/novals/templates/alpine-pod.yaml b/cmd/helm/testdata/testcharts/novals/templates/alpine-pod.yaml index f569d556c..564429dea 100644 --- a/cmd/helm/testdata/testcharts/novals/templates/alpine-pod.yaml +++ b/cmd/helm/testdata/testcharts/novals/templates/alpine-pod.yaml @@ -10,6 +10,7 @@ metadata: # The "release" convention makes it easy to tie a release to all of the # Kubernetes resources that were created as part of that release. app.kubernetes.io/instance: {{.Release.Name | quote }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} # This makes it easy to audit chart usage. helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" annotations: diff --git a/docs/chart_template_guide/variables.md b/docs/chart_template_guide/variables.md index d924fe2cf..a2f017f92 100644 --- a/docs/chart_template_guide/variables.md +++ b/docs/chart_template_guide/variables.md @@ -117,6 +117,7 @@ metadata: # I cannot reference .Chart.Name, but I can do $.Chart.Name helm.sh/chart: "{{ $.Chart.Name }}-{{ $.Chart.Version }}" app.kubernetes.io/instance: "{{ $.Release.Name }}" + app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/managed-by: "{{ $.Release.Service }}" type: kubernetes.io/tls data: diff --git a/docs/charts_hooks.md b/docs/charts_hooks.md index 042adc456..1284b9c2f 100644 --- a/docs/charts_hooks.md +++ b/docs/charts_hooks.md @@ -116,6 +116,7 @@ metadata: labels: app.kubernetes.io/managed-by: {{.Release.Service | quote }} app.kubernetes.io/instance: {{.Release.Name | quote }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" annotations: # This is what defines this resource as a hook. Without this line, the diff --git a/docs/examples/alpine/templates/alpine-pod.yaml b/docs/examples/alpine/templates/alpine-pod.yaml index beafd7668..2b54811fd 100644 --- a/docs/examples/alpine/templates/alpine-pod.yaml +++ b/docs/examples/alpine/templates/alpine-pod.yaml @@ -9,7 +9,8 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} # The "app.kubernetes.io/instance" convention makes it easy to tie a release to all of the # Kubernetes resources that were created as part of that release. - app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/instance: {{ .Release.Name | quote }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} # This makes it easy to audit chart usage. helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} app.kubernetes.io/name: {{ template "alpine.name" . }} diff --git a/docs/examples/nginx/templates/configmap.yaml b/docs/examples/nginx/templates/configmap.yaml index 0141cbc69..d47992024 100644 --- a/docs/examples/nginx/templates/configmap.yaml +++ b/docs/examples/nginx/templates/configmap.yaml @@ -6,6 +6,7 @@ metadata: labels: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} app.kubernetes.io/name: {{ template "nginx.name" . }} data: diff --git a/docs/examples/nginx/templates/deployment.yaml b/docs/examples/nginx/templates/deployment.yaml index 08850935a..4a6211f62 100644 --- a/docs/examples/nginx/templates/deployment.yaml +++ b/docs/examples/nginx/templates/deployment.yaml @@ -13,6 +13,7 @@ metadata: # The "app.kubernetes.io/instance" convention makes it easy to tie a release to all of the # Kubernetes resources that were created as part of that release. app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} # This makes it easy to audit chart usage. helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} app.kubernetes.io/name: {{ template "nginx.name" . }} diff --git a/docs/examples/nginx/templates/post-install-job.yaml b/docs/examples/nginx/templates/post-install-job.yaml index 6e32086ab..1bb3e13f9 100644 --- a/docs/examples/nginx/templates/post-install-job.yaml +++ b/docs/examples/nginx/templates/post-install-job.yaml @@ -10,6 +10,7 @@ metadata: # The "app.kubernetes.io/instance" convention makes it easy to tie a release to all of the # Kubernetes resources that were created as part of that release. app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} # This makes it easy to audit chart usage. helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} app.kubernetes.io/name: {{ template "nginx.name" . }} diff --git a/docs/examples/nginx/templates/pre-install-secret.yaml b/docs/examples/nginx/templates/pre-install-secret.yaml index 07a9504b5..40451800d 100644 --- a/docs/examples/nginx/templates/pre-install-secret.yaml +++ b/docs/examples/nginx/templates/pre-install-secret.yaml @@ -7,6 +7,7 @@ metadata: labels: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} app.kubernetes.io/name: {{ template "nginx.name" . }} # This declares the resource to be a hook. By convention, we also name the diff --git a/docs/examples/nginx/templates/service-test.yaml b/docs/examples/nginx/templates/service-test.yaml index ffb37e9f4..867f077ee 100644 --- a/docs/examples/nginx/templates/service-test.yaml +++ b/docs/examples/nginx/templates/service-test.yaml @@ -5,6 +5,7 @@ metadata: labels: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} app.kubernetes.io/name: {{ template "nginx.name" . }} annotations: diff --git a/docs/examples/nginx/templates/service.yaml b/docs/examples/nginx/templates/service.yaml index 03f7aa2c6..0c26ad4f7 100644 --- a/docs/examples/nginx/templates/service.yaml +++ b/docs/examples/nginx/templates/service.yaml @@ -10,6 +10,7 @@ metadata: helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} name: {{ template "nginx.fullname" . }} spec: # Provides options for the service so chart users have the full choice diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index 962a542e5..72150f4b3 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -159,6 +159,7 @@ metadata: app.kubernetes.io/name: {{ include ".name" . }} helm.sh/chart: {{ include ".chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- with .Values.ingress.annotations }} annotations: @@ -193,30 +194,15 @@ kind: Deployment metadata: name: {{ template ".fullname" . }} labels: -<<<<<<< HEAD - app: {{ template ".name" . }} - chart: {{ template ".chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -======= app.kubernetes.io/name: {{ include ".name" . }} helm.sh/chart: {{ include ".chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/managed-by: {{ .Release.Service }} ->>>>>>> e328d00a... Updating to the k8s label convention spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: -<<<<<<< HEAD - app: {{ template ".name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template ".name" . }} - release: {{ .Release.Name }} -======= app.kubernetes.io/name: {{ include ".name" . }} app.kubernetes.io/instance: {{ .Release.Name }} template: @@ -224,7 +210,6 @@ spec: labels: app.kubernetes.io/name: {{ include ".name" . }} app.kubernetes.io/instance: {{ .Release.Name }} ->>>>>>> e328d00a... Updating to the k8s label convention spec: containers: - name: {{ .Chart.Name }} @@ -263,17 +248,11 @@ kind: Service metadata: name: {{ template ".fullname" . }} labels: -<<<<<<< HEAD - app: {{ template ".name" . }} - chart: {{ template ".chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -======= app.kubernetes.io/name: {{ include ".name" . }} helm.sh/chart: {{ include ".chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/managed-by: {{ .Release.Service }} ->>>>>>> e328d00a... Updating to the k8s label convention spec: type: {{ .Values.service.type }} ports: @@ -282,13 +261,8 @@ spec: protocol: TCP name: http selector: -<<<<<<< HEAD - app: {{ template ".name" . }} - release: {{ .Release.Name }} -======= app.kubernetes.io/name: {{ include ".name" . }} - app.kubernetes.io/instancelease: {{ .Release.Name }} ->>>>>>> e328d00a... Updating to the k8s label convention + app.kubernetes.io/instance: {{ .Release.Name }} ` const defaultNotes = `1. Get the application URL by running these commands: diff --git a/pkg/lint/rules/testdata/albatross/templates/svc.yaml b/pkg/lint/rules/testdata/albatross/templates/svc.yaml index 18b3c99ef..7ea916ed4 100644 --- a/pkg/lint/rules/testdata/albatross/templates/svc.yaml +++ b/pkg/lint/rules/testdata/albatross/templates/svc.yaml @@ -7,6 +7,7 @@ metadata: labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" kubeVersion: {{ .Capabilities.KubeVersion.Major }} spec: