✨ Load Balancer IPv6 as apiserver endpoint #1227
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
tofalse
. 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: