Skip to content
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

✨ Load Balancer IPv6 as apiserver endpoint #1227

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JochemTSR
Copy link

@JochemTSR JochemTSR commented Mar 25, 2024

What this PR does / why we need it:
A cluster can be provisioned with a HCloud Load Balancer, which is a convenient way to present a singular entrypoint to the API server. Currently, The API server endpoint used by e.g. the kubelet is always set to the Load Balancer's IPv4 address (if no explicit hostname was configured). This means that nodes need to have a public-facing IPv4 interface and address, as crucial Kubernetes components can otherwise not reach the API server and will fail to be properly provisioned.

Meanwhile, nodes without an IPv4 is already possible with CAPH HCloudMachineTemplates by setting spec.template.spec.publicNetwork.enableIPv4 to false. Doing so can yield worthwile cost savings if the provisioned nodes are rather small (e.g. CAX11), as one is charged a flat fee for using an IPv4 address. But, as mentioned before, such nodes would fail to provision if a Load Balancer is used. This PR introduces a feature that allows the API server endpoint to be set to the Load Balancer's public IPv6 instead of the IPv4. Doing so allows for successful initialization of a cluster without public IPv4 addresses on the nodes. Manifests to create a working example cluster can be found at (https://github.com/JochemTSR/clusterapi-playground/tree/main/ipv6dev).

It should be noted that while Cluster API does exactly what is asked I had to pull an nat64 trick to make GitHub (and therefore kubeadm initialization) work with IPv6-only nodes, as GH apparently doesn't do IPv6 yet. Until I find a more elegant way to ensure provisioning succeeds with IPv6 only, I'll hold off on proposing a flavor for this.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1218

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squash commits
  • include documentation
  • add unit tests

@janiskemper
Copy link
Contributor

thanks a lot @JochemTSR for your contribution! Is this ready to be tested and reviewed? If so, I would ask @guettli to have a look!

@JochemTSR
Copy link
Author

@guettli all seems good on my end and tests are passing, could you have a look?

@janiskemper
Copy link
Contributor

@JochemTSR sorry for letting you wait for so long. I'll do it myself now:

  1. Can you add a template for this feature to https://github.com/syself/cluster-api-provider-hetzner/tree/main/templates/cluster-templates?
  2. Can you maybe even add an e2e test for this (which is based on these templates) in https://github.com/syself/cluster-api-provider-hetzner/tree/main/test/e2e? You should probably also switch off the IPv4 addresses of the HCloudMachines to ensure that everything works only in IPv6.

Does this make sense to you? Do you think you can do also the e2e testing part?

@guettli
Copy link
Contributor

guettli commented May 8, 2024

@JochemTSR my teammate Janis asked you some question. Are still interested in getting your PR merged?

Please let us know your reasoning (even if you don't care anymore).

@rbjorklin
Copy link

For what it's worth I'd be interested in seeing this merged. I could probably help whip up the templates requested if that would help move things along.

@janiskemper
Copy link
Contributor

are you also able to write Go code? Then we could add an e2e test for it as well. That would be amazing! If not, any contribution is helpful :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use LoadBalancer IPv6 address
4 participants