Skip to content

Conversation

orange-hbenmabrouk
Copy link

@orange-hbenmabrouk orange-hbenmabrouk commented Aug 4, 2025

What type of PR is this?
/kind feature

What this PR does / why we need it:

This PR reverts the functionality of calico's default pool and make it configurable in the config map of calico.

Special notes for your reviewer:

This feature was removed on the version v2.23.0 with the removal of the config file and the usage of the config map instead. While this configuration of the default pool existed in the file it was absent in the config map.
Is there a proper way to defined the default IP pool that calico uses, instead of defining it in the config-map calico-config.yml ?

Does this PR introduce a user-facing change?:

Reintroduced support for configuring Calico's default IP pool via the calico-config ConfigMap (fixing behavior removed in v2.23.0)

Signed-off-by: Houssem Ben Mabrouk <[email protected]>
@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 Aug 4, 2025
Copy link

linux-foundation-easycla bot commented Aug 4, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: orange-hbenmabrouk / name: Houssem Ben Mabrouk (73c1069, c835918)

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

Welcome @orange-hbenmabrouk!

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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 4, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @orange-hbenmabrouk. 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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 4, 2025
@k8s-ci-robot k8s-ci-robot requested review from mzaian and VannTen August 4, 2025 09:59
@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 Aug 4, 2025
@yankay
Copy link
Member

yankay commented Aug 5, 2025

/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 Aug 5, 2025
@yankay
Copy link
Member

yankay commented Aug 11, 2025

HI @orange-hbenmabrouk

Which PR are you reverting?

@orange-hbenmabrouk
Copy link
Author

orange-hbenmabrouk commented Aug 11, 2025

HI @orange-hbenmabrouk

Which PR are you reverting?

Sorry for not being very clear in my PR description.

This PR reverts this PR #12369 and adds the feature in the config map template: https://github.com/kubernetes-sigs/kubespray/blob/master/roles/network_plugin/calico/templates/calico-config.yml.j2

Since the versions prior to v2.23 (<= v2.22) relies on the generated cni-calico.conflist file and mounts/uses that file.
From the version v2.23, the file cni-calico.conflist is no longer supported/generated and so the calico-config configMap takes it's place, but unfortunately that comes with the lost of the feature of assigning the ippools.

The missing implementation is only found here instead (release v2.22): https://github.com/kubernetes-sigs/kubespray/blob/release-2.22/roles/network_plugin/calico/templates/cni-calico.conflist.j2

@yankay
Copy link
Member

yankay commented Aug 11, 2025

HI @ErikJiang @cyclinder

Would you please help to review it ?

Copy link
Contributor

@cyclinder cyclinder left a comment

Choose a reason for hiding this comment

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

Yes, we previously removed the rendering of the calico-config file and now generate the CNI configuration through ConfigMap. Your changes make perfect sense.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 11, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cyclinder, orange-hbenmabrouk
Once this PR has been reviewed and has the lgtm label, please assign ant31 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@tico88612
Copy link
Member

/retest

"type": "calico-ipam",
{% if ipv4_stack %}
{% if calico_cni_pool %}
"ipv4_pools": ["{{ calico_pool_cidr | default(kube_pods_subnet) }}"],
Copy link
Member

Choose a reason for hiding this comment

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

If there is not specific reason, suggest calico_pool_cidr: "{{ kube_pods_subnet }}" and change this:

Suggested change
"ipv4_pools": ["{{ calico_pool_cidr | default(kube_pods_subnet) }}"],
"ipv4_pools": ["{{ calico_pool_cidr }}"],

WDYT?

Choose a reason for hiding this comment

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

The variable calico_pool_cidr is in a simple yaml files (not jinja), so your suggestion won't be interpreted correctly (it won't take the value of kube_pods_subnet, but it will process it as a string).

Copy link
Author

Choose a reason for hiding this comment

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

I've answered with the wrong account 😆 I am still here though

Copy link
Contributor

Choose a reason for hiding this comment

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

Variable located in defaults and vars are in fact interpreted by Ansible as jinja, so that should work.

Copy link
Contributor

Choose a reason for hiding this comment

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

This still needs to be addressed 🆙

Choose a reason for hiding this comment

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

@VannTen @tico88612
Sorry for the delay, the suggested improvements has been pushed.

{% endif %}
{% if ipv6_stack %}
{% if calico_cni_pool_ipv6 %}
"ipv6_pools": ["{{ calico_pool_cidr_ipv6 | default(kube_pods_subnet_ipv6) }}"],
Copy link
Member

Choose a reason for hiding this comment

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

Same suggestion

Choose a reason for hiding this comment

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

Same answer :)

Copy link

@CGHoussem CGHoussem Sep 1, 2025

Choose a reason for hiding this comment

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

Changes made in this commit: c835918

@tico88612
Copy link
Member

Please write the release-note.

@k8s-ci-robot k8s-ci-robot added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Aug 18, 2025
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 1, 2025
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 1, 2025
@orange-hbenmabrouk orange-hbenmabrouk force-pushed the revert_calico_default_pool branch from 461e9c9 to c835918 Compare September 1, 2025 09:44
@tico88612
Copy link
Member

One more about this, could you edit the release note in one line? Since release notes are bulleted, you don't need to use bullet points in the content.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. labels Sep 4, 2025
@orange-hbenmabrouk
Copy link
Author

One more about this, could you edit the release note in one line? Since release notes are bulleted, you don't need to use bullet points in the content.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants