https://rancher.com/ logo
#rke2
Title
b

bulky-eve-17563

09/18/2023, 12:21 PM
Hi all, I have an rke2 cluster and prometheus installed with prometheus-operator. I can’t understand how to solve the problem reported also in this issue Expose kube-scheduler, kube-controller-manager and etcd via k8s endpoints in rke clusters · Issue #21173 · rancher/rancher (github.com) Can you please help me to figure it out? Thank you
b

big-fall-51797

09/19/2023, 9:50 AM
Hi Salvatore, you can solve this problem by add these parameter in your rke2 config
for master:
Copy code
etcd-expose-metrics: true
kube-controller-manager-arg:
  - "bind-address=0.0.0.0"
kube-scheduler-arg:
  - "bind-address=0.0.0.0"
kube-proxy-arg:
  - "metrics-bind-address=0.0.0.0:10249"
  - "proxy-mode=ipvs"
  - "ipvs-strict-arp=true"
kube-proxy-extra-mount:
  - "/lib/modules:/lib/modules:ro"
for agent:
Copy code
kube-proxy-arg:
  - "metrics-bind-address=0.0.0.0:10249"
  - "proxy-mode=ipvs"
  - "ipvs-strict-arp=true"
kube-proxy-extra-mount:
  - "/lib/modules:/lib/modules:ro"
b

bulky-eve-17563

09/19/2023, 10:31 AM
Hi Xavier and thanks for your answer. Now all the metrics are correctly discovered except for kube-proxy. Maybe I’m missing something
The configuration looks correct to me, I have the following output in all the nodes:
Copy code
root@***:~# ss -alnp | grep -E "10257|2381|10249|10259"
tcp                LISTEN              0                    4096                                                                                              *:10249
but still the alert is firing
b

big-fall-51797

09/20/2023, 12:41 PM
you should add this config in your kube-stack-prometheus
Copy code
...
kubeProxy:
   service:
     selector:
        component: kube-proxy
b

bulky-eve-17563

09/20/2023, 3:48 PM
thank you so much, now it works correctly. Have a nice day!