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

network: add ipv6 only global option #11831

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

borislitv
Copy link
Contributor

@borislitv borislitv commented Dec 25, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:
Support ipv6 only clusters

Which issue(s) this PR fixes:
Fixes #5649

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Add support for ipv6 only cluster via "enable_ipv6only_stack_networks"

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. labels Dec 25, 2024
Copy link

linux-foundation-easycla bot commented Dec 25, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: borislitv / name: Boris (1f8b722)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Dec 25, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @borislitv!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubespray has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 25, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @borislitv. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Dec 25, 2024
@yankay
Copy link
Member

yankay commented Dec 26, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 26, 2024
Copy link
Member

@MrFreezeex MrFreezeex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, the initiative looks great. I left a few comments on possible improvements to improve readability though.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 16, 2025
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 16, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 16, 2025
@borislitv borislitv force-pushed the ipv6only branch 3 times, most recently from 420079a to 3dc5142 Compare January 24, 2025 16:09
@borislitv
Copy link
Contributor Author

borislitv commented Jan 24, 2025

It work in my vagrant:

root@k8s-1:/home/vagrant# kubectl get nodes -o wide
NAME    STATUS   ROLES           AGE     VERSION   INTERNAL-IP                           EXTERNAL-IP   OS-IMAGE           KERNEL-VERSION     CONTAINER-RUNTIME
k8s-1   Ready    control-plane   9m5s    v1.32.0   fd3c:b398:698:756:5054:ff:fe49:e571   <none>        Ubuntu 24.04 LTS   6.8.0-31-generic   containerd://1.7.24
k8s-2   Ready    control-plane   8m50s   v1.32.0   fd3c:b398:698:756:5054:ff:fe7d:1cd1   <none>        Ubuntu 24.04 LTS   6.8.0-31-generic   containerd://1.7.24
k8s-3   Ready    <none>          7m52s   v1.32.0   fd3c:b398:698:756:5054:ff:feb8:8851   <none>        Ubuntu 24.04 LTS   6.8.0-31-generic   containerd://1.7.24

/retest

@borislitv borislitv force-pushed the ipv6only branch 4 times, most recently from d1d99c7 to 4687e18 Compare January 25, 2025 15:33
@borislitv
Copy link
Contributor Author

@geneliu my test with kubeadm etcd but checked on my local vagrant with etcd without kubeadm.
@VannTen @MrFreezeex It seems like everything worked out

Copy link
Member

@MrFreezeex MrFreezeex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It looks good to me, could you just clean up a bit your commits 🙏?

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: borislitv, MrFreezeex, VannTen

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@borislitv
Copy link
Contributor Author

Thanks! It looks good to me, could you just clean up a bit your commits 🙏?

squashed

@MrFreezeex
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 27, 2025
@k8s-ci-robot k8s-ci-robot merged commit 76c0a3a into kubernetes-sigs:master Jan 27, 2025
55 checks passed
@VannTen
Copy link
Contributor

VannTen commented Jan 27, 2025

@borislitv

This appears to have broken pre-commit ansible-lint, would you mind taking a look ?

roles/kubernetes/client/tasks/main.yml:68: jinja[invalid][/]: An unhandled exception occurred while templating 
'{{ {'clusters': [{'cluster': (cluster_infos | combine({'server': 'https://' + (external_apiserver_address | ansible.utils.ipwrap) 
+ ':' + (external_apiserver_port | string)})), 'name': cluster_name}]} }}'. Error was a <class 
'ansible.errors.AnsibleFilterError'>, original message: Unrecognized type <<class 
'ansible.template.native_helpers.AnsibleUndefined'>> for ipwrap filter <value>

@borislitv
Copy link
Contributor Author

borislitv commented Jan 27, 2025

@borislitv

This appears to have broken pre-commit ansible-lint, would you mind taking a look ?

roles/kubernetes/client/tasks/main.yml:68: jinja[invalid][/]: An unhandled exception occurred while templating 
'{{ {'clusters': [{'cluster': (cluster_infos | combine({'server': 'https://' + (external_apiserver_address | ansible.utils.ipwrap) 
+ ':' + (external_apiserver_port | string)})), 'name': cluster_name}]} }}'. Error was a <class 
'ansible.errors.AnsibleFilterError'>, original message: Unrecognized type <<class 
'ansible.template.native_helpers.AnsibleUndefined'>> for ipwrap filter <value>

I'll see a couple of hours. and I'll make a new pr

@borislitv
Copy link
Contributor Author

' + (external_apiserver_address | ansible.utils.ipwrap)

  • ':' + (external_apiserver_port | string)})), 'name': cluster_name}]} }}'. Error was a <class
    'ansible.errors.AnsibleFilterError'>, original message: Unrecognized type <<class
    'ansible.template.native_helpers.AnsibleUndefined'>> for ipwrap filter

looks like a bug in ansible-lint ansible/ansible-lint#3136
which version does this play on?
unable to reproduce:(

@VannTen
Copy link
Contributor

VannTen commented Jan 27, 2025 via email

@VannTen
Copy link
Contributor

VannTen commented Jan 29, 2025

I think I figured out the issue. ansible-lint apparently install collections when running (from galaxy.yml I guess ?). It passes without issue if the collections are not installed, (and installs them), but fails when there are already installed (I think by default they are in ~/.ansible/collections)

@borislitv
Copy link
Contributor Author

I think I figured out the issue. ansible-lint apparently install collections when running (from galaxy.yml I guess ?). It passes without issue if the collections are not installed, (and installs them), but fails when there are already installed (I think by default they are in ~/.ansible/collections)

looked again at the template, unfortunately it will not work otherwise, because variable is needed without brackets in https://github.com/borislitv/kubespray/blob/1f8b722d4ccdef4d9049ba4855de5992a22704ea/roles/kubernetes/client/tasks/main.yml#L50

@VannTen
Copy link
Contributor

VannTen commented Jan 30, 2025

I didn't dig in the template itself, but it does not look like an actual problem, more like a bug in ansible-lint (similar but not identical to the one above). I'll open an issue over there to see what can be done about that 🤔

@ant31
Copy link
Contributor

ant31 commented Feb 3, 2025

This PR is not working on ipv4 only systems

@ant31
Copy link
Contributor

ant31 commented Feb 3, 2025

Also the configuration should be done once via set fact or something other mechanism than going down the road of a condition in every single variable, it won't be maintainable long-term to have a switch in every one of them.

for example so instead of doing

etcd_address: access_ipv6 if ipv6 else access_ip

I suggest to do:

access_ip: access_ipv6 if ipv6 else access_ip

That way the change is isolated in one location and propagated in every variable that uses or will use access_ip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. ci-extended Run additional tests cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When can we expect ipv6-only support ?
8 participants