fix: fix the service monitor label selector (#215)

This patch does the following:
1. Use "cadvisor.selectorLabels" to select services in the
   ServiceMonitor
2. Make spacing consistent across templates

Signed-off-by: Oleh Neichev <oleg.neichev@gmail.com>
This commit is contained in:
Oleh Neichev 2025-05-01 15:47:13 +03:00 committed by GitHub
parent 0813fbf1cf
commit f6d8c39f96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 7 deletions

View File

@ -1,7 +1,7 @@
apiVersion: v1
description: A chart for a Cadvisor deployment
name: cadvisor
version: 2.4.0
version: 2.4.1
appVersion: 0.52.1
home: https://github.com/google/cadvisor
sources:

View File

@ -12,4 +12,4 @@ rules:
verbs: ['use']
resourceNames:
- {{ template "cadvisor.name" . }}
{{- end -}}
{{- end -}}

View File

@ -14,4 +14,4 @@ subjects:
- kind: ServiceAccount
name: {{ template "cadvisor.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
{{- end -}}

View File

@ -35,7 +35,7 @@ spec:
{{- end }}
{{- end }}
serviceAccountName: {{ template "cadvisor.serviceAccountName" . }}
{{- if .Values.hostNetwork }}
{{- if .Values.hostNetwork }}
hostNetwork: true
{{- end }}
containers:
@ -82,4 +82,3 @@ spec:
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

View File

@ -9,7 +9,7 @@ metadata:
spec:
selector:
matchLabels:
app: {{ template "cadvisor.name" . }}
{{- include "cadvisor.selectorLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
@ -27,4 +27,3 @@ spec:
{{- toYaml .Values.metrics.metricRelabelings | nindent 8 }}
{{- end -}}
{{- end -}}