Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev-v2.9][forward-fit] Fix indent metrics relabellings for kube-state-metrics #3600

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ spec:
{{- if .Values.prometheus.monitor.honorLabels }}
honorLabels: true
{{- end }}
metricRelabelings:
{{- if .Values.prometheus.monitor.metricRelabelings }}
metricRelabelings:
{{- toYaml .Values.prometheus.monitor.metricRelabelings | nindent 8 }}
{{- end }}
{{ if .Values.global.cattle.clusterId }}
- sourceLabels: [__address__]
targetLabel: cluster_id
replacement: {{ .Values.global.cattle.clusterId }}
{{- end }}
{{ if .Values.global.cattle.clusterName }}
- sourceLabels: [__address__]
targetLabel: cluster_name
replacement: {{ .Values.global.cattle.clusterName }}
{{- end }}
{{ if .Values.global.cattle.clusterId }}
- sourceLabels: [__address__]
targetLabel: cluster_id
replacement: {{ .Values.global.cattle.clusterId }}
{{- end }}
{{ if .Values.global.cattle.clusterName }}
- sourceLabels: [__address__]
targetLabel: cluster_name
replacement: {{ .Values.global.cattle.clusterName }}
{{- end }}
{{- if .Values.prometheus.monitor.relabelings }}
relabelings:
{{- toYaml .Values.prometheus.monitor.relabelings | nindent 8 }}
Expand Down
4 changes: 2 additions & 2 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14867,7 +14867,7 @@ entries:
catalog.cattle.io/upstream-version: 45.31.1
apiVersion: v2
appVersion: v0.65.1
created: "2024-04-30T15:12:45.432076713-04:00"
created: "2024-04-30T17:19:41.152728032-04:00"
dependencies:
- condition: grafana.enabled
name: grafana
Expand Down Expand Up @@ -14939,7 +14939,7 @@ entries:
and Prometheus rules combined with documentation and scripts to provide easy
to operate end-to-end Kubernetes cluster monitoring with Prometheus using the
Prometheus Operator.
digest: 6cbd6e0776e5c0aca432a9060f172b0fa80679706ba9ea07c308605262d10b53
digest: 525907615f85ba523abc6f388c5110a7787f7c6b90b6c44fcea89b76c432b11d
home: https://github.com/prometheus-operator/kube-prometheus
icon: file://assets/logos/rancher-monitoring.png
keywords:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
--- charts-original/templates/servicemonitor.yaml
+++ charts/templates/servicemonitor.yaml
@@ -45,9 +45,19 @@
@@ -45,10 +45,20 @@
{{- if .Values.prometheus.monitor.honorLabels }}
honorLabels: true
{{- end }}
- {{- if .Values.prometheus.monitor.metricRelabelings }}
metricRelabelings:
+ {{- if .Values.prometheus.monitor.metricRelabelings }}
metricRelabelings:
{{- toYaml .Values.prometheus.monitor.metricRelabelings | nindent 8 }}
- {{- end }}
+ {{- end }}
+ {{ if .Values.global.cattle.clusterId }}
+ - sourceLabels: [__address__]
+ targetLabel: cluster_id
+ replacement: {{ .Values.global.cattle.clusterId }}
+ {{- end }}
+ {{ if .Values.global.cattle.clusterName }}
+ - sourceLabels: [__address__]
+ targetLabel: cluster_name
+ replacement: {{ .Values.global.cattle.clusterName }}
{{- end }}
+ {{ if .Values.global.cattle.clusterId }}
+ - sourceLabels: [__address__]
+ targetLabel: cluster_id
+ replacement: {{ .Values.global.cattle.clusterId }}
+ {{- end }}
+ {{ if .Values.global.cattle.clusterName }}
+ - sourceLabels: [__address__]
+ targetLabel: cluster_name
+ replacement: {{ .Values.global.cattle.clusterName }}
+ {{- end }}
{{- if .Values.prometheus.monitor.relabelings }}
relabelings:
{{- toYaml .Values.prometheus.monitor.relabelings | nindent 8 }}
@@ -81,10 +91,6 @@
{{- if .Values.prometheus.monitor.honorLabels }}
honorLabels: true
Expand Down