mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-31 14:36:20 -02:30
fix(etcd): update etcd-metrics to endpointslice using single subset (#12846)
Signed-off-by: Meza <meza-xyz@proton.me>
This commit is contained in:
@@ -82,7 +82,7 @@
|
|||||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
loop:
|
loop:
|
||||||
- etcd_metrics-endpoints.yml.j2
|
- etcd_metrics-endpointslices.yml.j2
|
||||||
- etcd_metrics-service.yml.j2
|
- etcd_metrics-service.yml.j2
|
||||||
when: etcd_metrics_port is defined and etcd_metrics_service_labels is defined
|
when: etcd_metrics_port is defined and etcd_metrics_service_labels is defined
|
||||||
tags:
|
tags:
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
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, 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') }}
|
|
||||||
protocol: TCP
|
|
||||||
{% endfor %}
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: discovery.k8s.io/v1
|
||||||
|
kind: EndpointSlice
|
||||||
|
metadata:
|
||||||
|
name: etcd-metrics
|
||||||
|
namespace: kube-system
|
||||||
|
labels:
|
||||||
|
k8s-app: etcd
|
||||||
|
app.kubernetes.io/managed-by: Kubespray
|
||||||
|
kubernetes.io/service-name: etcd-metrics
|
||||||
|
addressType: IPv4
|
||||||
|
endpoints:
|
||||||
|
{% for etcd_metrics_address, etcd_host in etcd_metrics_addresses.split(',') | zip(etcd_hosts) %}
|
||||||
|
- addresses:
|
||||||
|
- "{{ etcd_metrics_address | urlsplit('hostname') }}"
|
||||||
|
conditions:
|
||||||
|
ready: true
|
||||||
|
nodeName: {{ etcd_host }}
|
||||||
|
targetRef:
|
||||||
|
kind: Node
|
||||||
|
name: {{ etcd_host }}
|
||||||
|
{% endfor %}
|
||||||
|
ports:
|
||||||
|
- name: http-metrics
|
||||||
|
port: {{ etcd_metrics_port }}
|
||||||
|
protocol: TCP
|
||||||
Reference in New Issue
Block a user