Expose the etcd metrics on the node IP of the etcd members of k3s

This commit is contained in:
2026-10-09 12:56:24 +00:00
parent 2798853153
commit 37e21ead36
+9
View File
@@ -47,3 +47,12 @@
value: "{{ item.value }}"
sysctl_file: /etc/sysctl.d/90-inotify.conf
loop: "{{ {'fs.inotify.max_user_instances': 65536, 'fs.inotify.max_user_watches': 4194304} | dict2items }}"
# Without it etcd serves metrics on 127.0.0.1 only, out of reach of vmagent.
- name: Expose the etcd metrics on the node IP
tags: etcd_metrics
when: not (kubernetes.config_extra['disable-etcd'] | default(false))
lineinfile:
path: /etc/rancher/k3s/config.yaml
regexp: '^etcd-expose-metrics:'
line: 'etcd-expose-metrics: true'