ansible-role-kubernetes-ca icon indicating copy to clipboard operation
ansible-role-kubernetes-ca copied to clipboard

Add support for IPv6 addresses in certificate generation.

Open Matthew-Beckett opened this issue 2 years ago • 1 comments

This PR adds support for single-stack IPv6 by exposing a k8s_address_family variable which can be either ipv6 or ipv4.

This allows Ansible to properly parse the IPv6 address and ensure it's correctly wrapped before arriving at it's destination.

Matthew-Beckett avatar Jul 10 '23 14:07 Matthew-Beckett

Thanks for the PR! Maybe one thought upfront: k8s_address_family seems wrong to me. I guess dual-stack Kubernetes clusters will become more common now that Google Cloud added support for it and that Kubernetes dual-stack support is now getting more mature. IPv4 and IPv6 only K8s deployments won't be that common IMHO. So both IPv4 and IPv6 addresses should be collected and processed accordingly.

Indeed, I agree. The reason for this was a quick and dirty fix for single-stack IPv6 users which was blocking me. I agree it is not optimal, and we should strive to support all cases.

When I have more time I will improve this PR to be more idempotent.

Matthew-Beckett avatar Jul 17 '23 12:07 Matthew-Beckett