Skip to content

Commit

Permalink
Add node label to etcd metrics (kubernetes-sigs#8475)
Browse files Browse the repository at this point in the history
targetRef on endpoints surfaces as
__meta_kubernetes_endpoint_address_target_kind/__meta_kubernetes_endpoint_address_target_name
in prometheus and gets converted to the label `node` by
prometheus-operator
  • Loading branch information
fungusakafungus authored and sakuraiyuta committed Apr 16, 2022
1 parent 4161794 commit 950f506
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ metadata:
k8s-app: etcd
app.kubernetes.io/managed-by: Kubespray
subsets:
{% for etcd_metrics_address in etcd_metrics_addresses.split(',') %}
{% for etcd_metrics_address, etcd_host in etcd_metrics_addresses.split(',') | zip(etcd_hosts) %}
- addresses:
- ip: {{ etcd_metrics_address | urlsplit('hostname') }}
targetRef:
kind: Node
name: {{ etcd_host }}
ports:
- name: http-metrics
port: {{ etcd_metrics_address | urlsplit('port') }}
Expand Down

0 comments on commit 950f506

Please sign in to comment.