-
Notifications
You must be signed in to change notification settings - Fork 116
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
feat: add ability to use node ip as LB target #590
base: main
Are you sure you want to change the base?
Conversation
Hey @blitss, thanks for the PR! I am currently on vacation, and will take a look at this in January. |
Any news here? |
This PR has been marked as stale because it has not had recent activity. The bot will close the PR if no further action occurs. |
@jooola do you want me to resolve that changes for you or will you check it out? |
@blitss Sorry for the delay, we are currently low resource to work on this Pull Request. But we don't want this PR to vanish without giving you a proper review/answer, I will therefor pin the PR for now. No, don't bother about the conflict for now. |
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.
I did a very quick review, but I'll not be able to give the final word on this PR.
@@ -91,6 +92,7 @@ func getRobotServerByID(c robot.Client, id int, node *corev1.Node) (*hrobotmodel | |||
|
|||
// check whether name matches - otherwise this server does not belong to the respective node anymore | |||
if server.Name != node.Name { | |||
klog.Warningf("%s: server %d has name %q, but node %q has name %q. if you want node to be matched with node in Hetzner Robot you should rename it.", op, id, server.Name, node.Name, node.Name) |
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.
This seems unrelated to this PR, but might be a good addition.
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.
Do you want this to be a separate PR or just a separate commit?
@@ -31,6 +31,7 @@ const ( | |||
hcloudLoadBalancersNetworkZone = "HCLOUD_LOAD_BALANCERS_NETWORK_ZONE" | |||
hcloudLoadBalancersDisablePrivateIngress = "HCLOUD_LOAD_BALANCERS_DISABLE_PRIVATE_INGRESS" | |||
hcloudLoadBalancersUsePrivateIP = "HCLOUD_LOAD_BALANCERS_USE_PRIVATE_IP" | |||
hcloudLoadBalancersUseNodeIP = "HCLOUD_LOAD_BALANCERS_USE_NODE_IP" |
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.
I am not sure about the naming or the option, this seems to target robot server only right?
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.
I don't recall but I think it does yes. But we can make it work with cloud servers too, is this the way?
Update: there's an option which uses private IP and I believe it is used in conjunction with cloud servers. Do we need this option for the cloud servers in that case?
Thanks @blitss for the work! FYI: |
(sorry for any possible mistakes in this PR, I'm not really familiar with Go)
In this PR I added the ability to use node ip as the target for the Hetzner LB. The motivation behind this is that current Robot implementation only adds public IPs from the Robot to the LB, and someone might have cluster setup like this, which uses internal IP from the vswitch.
which just doesn't work with following implementation. I also added warning for when the name in the Robot and k8s don't match. It's opt-in and you have to specify
HCLOUD_LOAD_BALANCERS_USE_NODE_IP
to use that.I ran the controller like
and it worked like a charm for me. Result:
Since you're specifying a network I have to also use flags like
HCLOUD_NETWORK_ROUTES_ENABLED
andHCLOUD_NETWORK_DISABLE_ATTACHED_CHECK
.Would love to add test for it, but I think it's going to add a lot of complexities testing this along with a vswitch.