mxschmitt / ui-driver-hetzner

Rancher UI driver for the Hetzner Cloud docker driver.
https://mxschmitt.github.io/ui-driver-hetzner
Apache License 2.0
254 stars 50 forks source link

Question: how are server labels supported? #100

Closed tgruenert closed 3 years ago

tgruenert commented 3 years ago

Assuming 1) new servers should be scheduled manually or automatic to manage higher load. 2) a loadbalancer is used.

If new nodes created, the load balancer need to know them. As fare as i understand, therefore we have labels at hetzner cloud.

But how can i set a label inside kubernetes / rancher node template to give this label to new provisionied machines at startup?

Maybe i don´t see the white elephant? ;-) Thanks!

tgruenert commented 3 years ago

This may be duplicate to https://github.com/mxschmitt/ui-driver-hetzner/issues/93 and an idea for workaround is https://github.com/mxschmitt/ui-driver-hetzner/issues/93#issuecomment-674944056 ith implementation on https://github.com/BlueBambooStudios/hcloud-connect

Have to check this ;-).

ItsReddi commented 3 years ago

Beside of your usecase it would be nice to be able to label nodes on at hetzner cloud via node templates

ricktap commented 3 years ago

I opened an issue on the docker-machine driver itself (https://github.com/JonasProgrammer/docker-machine-driver-hetzner/issues/56#issue-775953113). Labels are not supported right now, so there is no way for this project to implement it, without the proposed change on the upstream project. We would need exactly the same feature for the same reasons you described above. Feel free to upvote my issue on the machine driver, in case you still need this to be implemented. I would create a PR on the node driver repository, once the upstream implemented the additional option. The change in here would be relatively simple.

NotANormalNerd commented 3 years ago

@ricktap Is this still on the table? I am currently setting up a new cluster and would love to use the labels set in Kubernetes for the nodes to be set in Hetzner as well.

NotANormalNerd commented 3 years ago

@mxschmitt Would you mind merging the PRs and publishing a new Version? Or should we fork and move?

mxschmitt commented 3 years ago

@NotANormalNerd I will, is tomorrow enough? Then I can also test it on my own and ensure that it works for the other users.

Thanks for your PR! 💯

NotANormalNerd commented 3 years ago

Tomorrow would be fast as lightning, also it's sunday, so no hurry. Thanks for your work. There is another PR I just opened, but we have to wait for JonasProgrammer there.

dj9pz commented 3 years ago

Any news on support for serverLabels? The docker machine driver (https://github.com/JonasProgrammer/docker-machine-driver-hetzner) supports them since version 3.2.0 on January 1st (https://github.com/JonasProgrammer/docker-machine-driver-hetzner/releases/tag/3.2.0):

added --hetzner-server-label option: Servers can now be assigned additional metadata during creation, e.g. for use with k8s and load balancers

Thanks!

mxschmitt commented 3 years ago

Labels should work since #109. Will close this issue since it seems integrated.