hcloud-cloud-controller-manager icon indicating copy to clipboard operation
hcloud-cloud-controller-manager copied to clipboard

feat: add ability to use node ip as LB target

Open blitss opened this issue 2 years ago • 6 comments

(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.

k get node -o wide
NAME    STATUS   ROLES           AGE     VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE                KERNEL-VERSION   CONTAINER-RUNTIME
node1   Ready    control-plane   5h51m   v1.28.3   10.0.1.3      <none>        Talos (v1.6.0-beta.1)   6.1.65-talos     containerd://1.7.10

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

 ROBOT_ENABLED=true \
HCLOUD_TOKEN= ROBOT_PASSWORD=ROBOT_USER="" \
KUBECONFIG=$HOME/.kube-old/config  \
HCLOUD_NETWORK=1047143 \
HCLOUD_NETWORK_ROUTES_ENABLED=false \
HCLOUD_NETWORK_DISABLE_ATTACHED_CHECK=true \
HCLOUD_LOAD_BALANCERS_USE_NODE_IP=true \
go run . --allow-untagged-cloud  --cloud-provider=hcloud --route-reconciliation-period=30s --webhook-secure-port=0 --leader-elect=false --kubeconfig=$HOME/.kube-old/config

and it worked like a charm for me. Result:

Pasted_Image_16_12_23__02_45

Since you're specifying a network I have to also use flags like HCLOUD_NETWORK_ROUTES_ENABLED and HCLOUD_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.

blitss avatar Dec 15 '23 23:12 blitss

Hey @Blitss, thanks for the PR! I am currently on vacation, and will take a look at this in January.

apricote avatar Dec 17 '23 13:12 apricote

Any news here?

PReimers avatar Feb 09 '24 19:02 PReimers

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.

github-actions[bot] avatar May 10 '24 12:05 github-actions[bot]

@jooola do you want me to resolve that changes for you or will you check it out?

blitss avatar Jun 10 '24 10:06 blitss

@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.

jooola avatar Jun 10 '24 10:06 jooola