Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Fix K8s API server connectivity for IPv6 #7

Merged
merged 4 commits into from Jan 19, 2022

Conversation

mKeRix
Copy link
Contributor

@mKeRix mKeRix commented Jan 18, 2022

The upstream library kube-rs uses an old way of connection to the K8s API, which in their implementation breaks on IPv6 clusters due to wrong URL formatting. This forces the lib to use the proper service, which works on IPv6 clusters as well. The hint towards this solution is from kube-rs/kube#587 - the fix they implemented there is specific to using the rustls feature, which is not in use in this project. But the workaround works regardless.

I also made the env variables configure as a Helm value, in case somebody else needs to change something there in the future. Currently we've applied this fix with kustomize, but having it directly in the chart would let us get rid of that complexity. Plus, others can benefit as well. :)

The upstream library kube-rs uses an old way of connection to the K8s API, which in their
implementation breaks on IPv6 clusters due to wrong URL formatting.
This forces the lib to use the proper service, which works on IPv6
clusters as well.
@alex-berger
Copy link
Collaborator

@mKeRix Isn't this fixed in kube-rs/kube#597, if so the proper fix would be to upgrade the latest kube-rs version.

@alex-berger
Copy link
Collaborator

alex-berger commented Jan 18, 2022

Isn't this fixed in kube-rs/kube-rs#597, if so the proper fix would be to upgrade the latest kube-rs version.

(Note to myself) No, it is not fixed in upstream kube-rs , as kube-rs does not properly format IPv6 addresses in URL, it will create something like https://::1:443 (which is invalid) instead of https://[::1]:443.

@mKeRix If you can address my comment above, I will happily merge this PR.

There's no reason why this would need to be applied to IPv4 cluster, so
instead it can simply be an optional setting with a note.
@mKeRix
Copy link
Contributor Author

mKeRix commented Jan 19, 2022

Indeed. Sorry, I should've made that clearer in my initial post. I have updated the pull request accordingly now. :)

@alex-berger alex-berger merged commit 5d5fcc0 into rustrial:main Jan 19, 2022
@mKeRix mKeRix deleted the eks-ipv6-fix branch January 19, 2022 10:38
@alex-berger
Copy link
Collaborator

@mKeRix this PR is now part of today's v0.1.6 release. Thanks for the PR.

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

Successfully merging this pull request may close these issues.

None yet

2 participants