-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Kubernetes: node autodiscover, add InternalIP #15930
Kubernetes: node autodiscover, add InternalIP #15930
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first glance it looks a bit complicated and I was thinking for a while how you can make this straighforward...
What do you think about splitting responsibilities here into half, firstly - find external and internal IP, secondly - take a decision about IP address. You may even don't need a comment :)
} | ||
|
||
// getAddress returns an IP address from a kubernetes node. | ||
// | ||
// It will use external IP if existing, falling back to Internal IP if not, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: either InternalIP
or internal IP
} | ||
|
||
// getAddress returns an IP address from a kubernetes node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Kubernetes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
With this change we have an order of preference for the address we return. We should probably document it, WDYT? Would it make sense to also expose both internal and external IPs in other fields of the event? |
* use any node ip (cherry picked from commit 6273589)
complementary to #14738 (comment)
Autodiscover for nodes should use not only the external IP but also the internal one.