-
Notifications
You must be signed in to change notification settings - Fork 745
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
kubectl logs breaks when using the cni plugin #21
Comments
Hi @dezmodue , thank you for reporting the issue and also providing a solution. The cni plugin back-end (L-IPAM) allocates IP addresses on the primary ENI interface right after it is initialized. So at the time when kubelet is reporting node address, the primary ENI interface already have multiple secondary IP addresses assigned. So the recommendation (which you have already verified) is to pass the --node-ip=$(curl http://169.254.169.254/latest/meta-data/local-ipv4) argument to the kubelet. I am closing the issue. Please reopen it if you still think this is a problem. thanks |
@liwenwu-amazon thanks for your response. I think if this is the official recommendation then it is worth making it explicit in the readme for users and other projects. Did you see the same issue occurring in EKS? Is the kubelet passed --node-ip? I wasn't able to reproduce the issue when using a different cni and manually attaching a second eni + secondary IPs on the enis at boot (the kubelet correctly reports the InternalIP and all the secondary IPs on eth0). Do you have any insight into how the issue could be triggered only by this cni? |
@dezmodue Thank you again. Yes we need to make it explicit in the readme. I am reopening the issue to track this. This CNI allocates the secondary IP addresses on the instance's primary ENI right after it is initialized. I suspect other CNIs do not perform this action at boot time. Also, were you manually allocate secondary IP addresses on the instance's primary ENI at boot time (in another word even before kubelet finishing initialization)? |
@liwenwu-amazon in my test I would:
What I could see is that in that case the kubelet was correctly reporting all the IPs associated to the Primary eni (primary and secondary) and correctly set the InternalIP as the primary IP on the primary eni (which also confirmed the IPs and eni were associated before the kubelet was started) |
@dezmodue thank you again for your test. I suspect in your case, the kubelete reports the node address before the change that you made through console finally get realized on the node. Here is what I am seeing on my setup:
Here are snips of kubelet code
|
@liwenwu-amazon thanks for your reply. |
@dezmodue Thank you and we will update README.md and make it explicit to users and other projects. |
For anyone struggling with the issue and using kops, this has been recently fixed in kops: kubernetes/kops@e406dbf. |
Hi, moving kubernetes/kops#4218 here as suggested
I am getting an error when running
kubectl logs POD -n NAMESPACE
, specifically:This error seems to be related to the fact that the kubelet is registering the wrong IP, it seems that the kubelet reports one of the secondary private IPs (on eth0 as far as I can tell)
In the example error reported:
10.103.20.110 is a secondary private IP on eth0 and it is the IP shown by kubectl describe node:
Note that only a single InternalIP is reported and it is not the one the kubelet is listening on
Locally curl works on both the primary IPs on eth0 and eth1
The problem has also been occurring on the master nodes and it manifests with new nodes unable to join the cluster because the kubelet is unable to contact the API (the IPs are wrong)
If I pass the --node-ip=$(curl http://169.254.169.254/latest/meta-data/local-ipv4) argument to the kubelet everything works as expected
I could not reproduce this specific issue by simply adding an extra eni and secondary IPs (trying to emulate the plugin behaviour) on a cluster running the flannel overlay network - the kubelet reports all available IP Addresses correctly
Versions:
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.4", GitCommit:"9befc2b8928a9426501d3bf62f72849d5cbcd5a3", GitTreeState:"clean", BuildDate:"2017-11-20T05:17:43Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
The text was updated successfully, but these errors were encountered: