c12s-kubespray/roles/kubernetes-apps/ansible/templates/etcd_metrics-endpoints.yml.j2
Mathieu Parent 0263c649f4
Allow to scrape etcd metrics using a service (#8203)
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
2021-11-17 23:53:01 -08:00

17 lines
446 B
Django/Jinja

apiVersion: v1
kind: Endpoints
metadata:
name: etcd-metrics
namespace: kube-system
labels:
k8s-app: etcd
app.kubernetes.io/managed-by: Kubespray
subsets:
{% for etcd_metrics_address in etcd_metrics_addresses.split(',') %}
- addresses:
- ip: {{ etcd_metrics_address | urlsplit('hostname') }}
ports:
- name: http-metrics
port: {{ etcd_metrics_address | urlsplit('port') }}
protocol: TCP
{% endfor %}