Fix serviceMonitorKubelet's metricRelabelings

Insert the metricRelabelings at the proper level.

Signed-off-by: Jetchko Jekov <jetchko.jekov@gmail.com>
This commit is contained in:
Jetchko Jekov committed 2020-04-07 08:50:43 +02:00
1 parent f23da9ccad
commit 81449209a5
1 file changed
+15 -7
+15 -7
View File
@@ -27,13 +27,21 @@
prometheus+:: { prometheus+:: {
serviceMonitorKubelet+: { serviceMonitorKubelet+: {
spec+: { spec+: {
metricRelabelings+: [ endpoints: std.map(function(endpoint)
{ if endpoint.port == "https-metrics" then
action: 'replace', endpoint {
sourceLabels: ['node'], metricRelabelings+: [
targetLabel: 'instance', {
}, action: 'replace',
], sourceLabels: ['node'],
targetLabel: 'instance',
},
],
}
else
endpoint,
super.endpoints
),
}, },
}, },
}, },