rancher-node-exporter: updating metricRelabelings to include cluster names

pull/2621/head
Geet Samra 2023-05-12 15:48:11 -07:00
parent 6e1b64438c
commit 834896da1a
2 changed files with 17 additions and 13 deletions

View File

@ -1,20 +1,24 @@
--- charts-original/templates/servicemonitor.yaml
+++ charts/templates/servicemonitor.yaml
@@ -47,5 +47,17 @@
{{- with .Values.prometheus.monitor.metricRelabelings }}
metricRelabelings:
@@ -44,8 +44,18 @@
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
- {{- with .Values.prometheus.monitor.metricRelabelings }}
metricRelabelings:
- {{- toYaml . | nindent 8 }}
- {{- end }}
+ {{- with .Values.prometheus.monitor.metricRelabelings }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{ if .Values.global.cattle.clusterId }}
+ - sourceLabels: [__address__]
+ targetLabel: cluster_id
+ eplacement: {{ .Values.global.cattle.clusterId }}
+ {{- end }}
+ {{ else }}
+ {{ if .Values.global.cattle.clusterId }}
+ metricRelabelings:
+ {{ if .Values.global.cattle.clusterName }}
+ - sourceLabels: [__address__]
+ targetLabel: cluster_id
+ replacement: {{ .Values.global.cattle.clusterId }}
+ targetLabel: cluster_name
+ replacement: {{ .Values.global.cattle.clusterName }}
+ {{- end }}
{{- end }}
{{- end }}

View File

@ -41,12 +41,12 @@
pspAnnotations: {}
# for deployments that have node_exporter deployed outside of the cluster, list
@@ -163,6 +167,8 @@
@@ -164,6 +168,8 @@
tolerations:
- effect: NoSchedule
+ operator: Exists
+ - effect: NoExecute
operator: Exists
+ - effect: NoExecute
+ operator: Exists
## Assign a PriorityClassName to pods if set
# priorityClassName: ""