-
Notifications
You must be signed in to change notification settings - Fork 129
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
Kilo Incorrectly Chooses an eth0 IP Over Node's Configured Internal IP #367
Comments
Hi @boedy, the following file [0] contains all of the logic used for discovering IP addresses and includes some comments to describe the prioritization of interfaces and addresses. Would you mind providing some more details on the specific situation? What are the IPs in question? What IP is Kilo selecting? What IP did you expect to be selected? Also, what interfaces are these IPs assigned to? [0] https://github.com/squat/kilo/blob/main/pkg/mesh/discoverips.go |
Hi @squat This is the situation on one of my nodes. Kilo resolves the interal ip to
Leaving that aside. The Kubernetes api lists the correct internel IP which I was referring to initially as the "K8S internal ip":
|
Hmm I agree that relying on the IPs registered on the node objects in the Kubernetes API would be a great default (internal IPs are not always available so some discovery code will still be necessary) however it's not entirely trivial. An easier implementation would be to copy the logic used by the kubelet for IP discovery during node registration. Out of curiosity, what makes this IP on this interface "the correct IP"? I wonder if we can translate your needs into a heuristic during IP discovery. |
Oh right, the internal IPs are registered by the controllers for each cloud, which are not always available depending on the flavor of Kubernetes and the cloud/on premises situation. |
I'd argue that if node objects don't have an Internal IP defined, it likely means there's no internal network for communication. As you pointed out, many cloud providers handle this automatically. In my case I'm running K3S on Baremetal + multiple clouds (This is where Kilo comes in 😄 ) and I manually set the internal IP. For scenarios where someone might want to use a third network layer specifically for Kilo communication, the Relying on heuristics might not always pinpoint the right internal IP address, given the diverse ways machines can be configured. However, I get the need for them, especially for maintaining backward compatibility. |
Oh and one thing I should add - and why I opened this issue in the first place - is that with k3s for example I can set node labels when provisioning, but I'm not able to specify annotations. This means that in my current setup I have to manually add the To give you a concrete example how I provision my worker nodes through cloud-init:
|
When deploying Kilo on DigitalOcean, I've noticed that it fetches the wrong internal IP. Specifically, it seems to be selecting an internal IP bound to the eth0 interface.
All my Kubernetes nodes are correctly configured with their respective internal IPs. I've reviewed the Kilo codebase but couldn't pinpoint where the internal IP is determined outside of setting it through annotations.
Could you provide some insight into why Kilo doesn't use the default internal IP set for the nodes? It would be beneficial to understand the logic behind this and if there's a way to ensure the correct IP is used. Using the K8S internal ip seems like a sane default.
The text was updated successfully, but these errors were encountered: