Browse Source

Add node label to etcd metrics (#8475)

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
pull/8496/head
Ilya Margolin 2 years ago
committed by GitHub
parent
commit
2bbe5732b7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions
  1. 5
      roles/kubernetes-apps/ansible/templates/etcd_metrics-endpoints.yml.j2

5
roles/kubernetes-apps/ansible/templates/etcd_metrics-endpoints.yml.j2

@ -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') }}

Loading…
Cancel
Save