-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metrics-server is unable to scrape node when using custom bind-address #10749
Comments
|
@brandond, I'm looking at the |
Second sentence of the section you linked:
Don't try to run both agent and server on the same host. As that says, servers also include agent functionality. |
Thank you @brandond, I'm running the server on 3 control-planes and agent on 5 workers. I'll set the |
Yes |
I just tried to set the Edit: further more,
Warning samples I get in
Also, I see the |
Why are you setting all these things? What are you trying to do? If you just leave the node ip and bind address unset it should do the correct thing. The supervisor metrics are not even related to the kubelet metrics you appear to be trying to scrape. Make sure port 10250 is open between all your nodes, and that they can reach each other at their listed addresses. |
@brandond I need to set the bind-address because I'm running HAProxy on two of control-planes.
I think I know where is the issue, port 10250 is properly assigned for all server nodes:
On agent nodes, it is not assigned to a specific IP address, VictoriaMetrics is trying to connect to
I was wondering what is the correct way to define a specific IP into agent nodes for 10250 port. Here is a
Looking at
BTW, thank you for taking the time to provide support to everyone for many k3s related issues, it is really appreciated. |
It looks like its listening on the correct ports, however something is rejecting connections to that port on the nodes, from whatever node that pod is running on. If you have local firewalls on the nodes (ufw/firewalld) or security groups, make sure that port 10250 is open. |
Firewall is disabled, running Ubuntu LTS 24.04 on all nodes. I'm going to set an |
@brandond this actually breaks the service but gives some clarity where the issue might be:
Ubuntu is setting the hostname to:
How would you deal with the Systemd service output:
|
Removing the
The
I get a 401:
|
@brandond I figured where is the issue, K3s disables kublelet anonymous authentication. Also, I decided to disable I still have an issue scraping in VictoriaMetrics, only on servers. Getting 403's instead of 401's, when I enable |
Don't turn on anonymous auth. That is the wrong way to solve the problem. Metrics-server and other scrapers should use service accounts to authenticate. |
Yes, I definitely don't want to do that. I simply wanted to see if there is an additional connectivity problem that anonymous auth might mask. I'll open a new issue and post all technical details in there. |
Environmental Info:
K3s Version:
It happens on the currently newest available version:
But this issue first occurred in this version:
This is the last version it worked with:
I think this behaviour was introduced by #10019
Node(s) CPU architecture, OS, and Version:
Cluster Configuration:
Single-node k3s cluster with the following config:
Describe the bug:
After k3s
v1.29.6+k3s1
and when specifying a custombind-address
the metrics server is unable to connect to the Kubelet metrics.Logs of metrics server before `v1.29.6+k3s1` with this config:
Kubelet metrics are available at
*:10250
beforev1.29.6+k3s1
with this config:After
v1.29.6+k3s1
and newer, this socket binds to<bind-address>:10250
instead:This leads the metrics server unable to scrape the node, as it tries to connect via the node ip:
Steps To Reproduce:
Download k3s
v1.29.6+k3s1
or newer:Use this config (
/etc/rancher/k3s/config.yaml
):Add IP to loopback interface
(Verify it:)
Start k3s:
Check that it binds the
bind-address
:View logs of metrics-server:
Expected behavior:
I would expect the metrics-server to not use the node ip (in this case
172.20.32.116
), but the bind-address instead.Actual behavior:
The metrics-server uses the node ip.
The text was updated successfully, but these errors were encountered: