Skip to content

Commit

Permalink
add metrics-server.podLabels so that we app.kubernetes.io/version is …
Browse files Browse the repository at this point in the history
…set on pods
  • Loading branch information
jhulick committed Nov 26, 2024
1 parent 9ebbad9 commit 8bf1b80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions charts/metrics-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ app.kubernetes.io/name: {{ include "metrics-server.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Pod labels
*/}}
{{- define "metrics-server.podLabels" -}}
{{ include "metrics-server.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/metrics-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
template:
metadata:
labels:
{{- include "metrics-server.selectorLabels" . | nindent 8 }}
{{- include "metrics-server.podLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down

0 comments on commit 8bf1b80

Please sign in to comment.