Skip to content

Commit

Permalink
[prometheus-node-exporter] Update labels
Browse files Browse the repository at this point in the history
Signed-off-by: QuentinBisson <quentin@giantswarm.io>
  • Loading branch information
QuentinBisson committed Jun 29, 2022
1 parent 16437f0 commit 1b36929
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-node-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- prometheus
- exporter
type: application
version: 3.3.0
version: 3.4.0
appVersion: 1.3.1
home: https://github.com/prometheus/node_exporter/
sources:
Expand Down
14 changes: 10 additions & 4 deletions charts/prometheus-node-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,21 @@ If release name contains chart name it will be used as a full name.

{{/* Generate basic labels */}}
{{- define "prometheus-node-exporter.labels" }}
app: {{ template "prometheus-node-exporter.name" . }}
heritage: {{.Release.Service }}
release: {{.Release.Name }}
chart: {{ template "prometheus-node-exporter.chart" . }}
{{- include "prometheus-node-exporter.selector" . }}
app.kubernetes.io/version: {{ .Chart.Version | quote }}
helm.sh/chart: {{ template "prometheus-node-exporter.chart" . }}
{{- if .Values.podLabels}}
{{ toYaml .Values.podLabels }}
{{- end }}
{{- end }}

{{/* Generate selector labels */}}
{{- define "prometheus-node-exporter.selector" }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ template "prometheus-node-exporter.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
3 changes: 1 addition & 2 deletions charts/prometheus-node-exporter/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ metadata:
spec:
selector:
matchLabels:
app: {{ template "prometheus-node-exporter.name" . }}
release: {{ .Release.Name }}
{{- include "prometheus-node-exporter.selector" . | indent 6 }}
{{- if .Values.updateStrategy }}
updateStrategy:
{{ toYaml .Values.updateStrategy | indent 4 }}
Expand Down
3 changes: 1 addition & 2 deletions charts/prometheus-node-exporter/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ spec:
protocol: TCP
name: {{ .Values.service.portName }}
selector:
app: {{ template "prometheus-node-exporter.name" . }}
release: {{ .Release.Name }}
{{- include "prometheus-node-exporter.selector" . | indent 4 }}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ spec:
{{- if .Values.prometheus.monitor.selectorOverride }}
{{ toYaml .Values.prometheus.monitor.selectorOverride | indent 6 }}
{{ else }}
app: {{ template "prometheus-node-exporter.name" . }}
release: {{ .Release.Name }}
{{ include "prometheus-node-exporter.selector" . | indent 6 }}
{{- end }}
endpoints:
- port: {{ .Values.service.portName }}
Expand Down

0 comments on commit 1b36929

Please sign in to comment.