diff --git a/roles/kubernetes-apps/ansible/templates/etcd_metrics-endpoints.yml.j2 b/roles/kubernetes-apps/ansible/templates/etcd_metrics-endpoints.yml.j2 index d8b4bcd90..18f515d18 100644 --- a/roles/kubernetes-apps/ansible/templates/etcd_metrics-endpoints.yml.j2 +++ b/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') }}