Skip to content

Feat: add Cilium LB IP Pool configuration to support ranges #12140

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

Merged
merged 1 commit into from
May 12, 2025

Conversation

Kimcheolhui
Copy link
Contributor

What type of PR is this?
/kind documentation
/kind feature

What this PR does / why we need it:
This PR will support Cilium LB IP Pool configuration for ranges which is start-stop and start.
Details on #12036

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

Special notes for your reviewer:
Reference: Cilium Docs - LB IPAM Pools

Does this PR introduce a user-facing change?:

Add support for `ranges:` (start‑stop or single start) as an additional way to define Cilium LoadBalancer IP pools, alongside the existing `cidrs:` field.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/documentation Categorizes issue or PR as related to documentation. labels Apr 19, 2025
Copy link

linux-foundation-easycla bot commented Apr 19, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 19, 2025
@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 19, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @Kimcheolhui!

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 Apr 19, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @Kimcheolhui. 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 size/S Denotes a PR that changes 10-29 lines, ignoring generated files. 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 Apr 19, 2025
@tico88612
Copy link
Member

/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 Apr 20, 2025
@tico88612
Copy link
Member

/retitle Feat: add Cilium LB IP Pool configuration to support ranges

@k8s-ci-robot k8s-ci-robot changed the title Update: add Cilium LB IP Pool configuration to support ranges Feat: add Cilium LB IP Pool configuration to support ranges Apr 20, 2025
@tico88612
Copy link
Member

/retest-failed

Copy link
Member

@tico88612 tico88612 left a comment

Choose a reason for hiding this comment

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

Thanks!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 23, 2025
{% for rblock in cilium_loadbalancer_ip_pool.ranges | default([]) %}
- start: "{{ rblock.start }}"
stop: "{{ rblock.stop | default(rblock.start) }}"
{% endfor %}
{% endfor %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be simplified to a | to_yaml filter ? Or is there something I'm missing ?

Copy link
Contributor Author

@Kimcheolhui Kimcheolhui Apr 26, 2025

Choose a reason for hiding this comment

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

Thanks for the review! @VannTen

Using | to_yaml is possible, but then k8s-net-cilium.yml must be slightly modified.

The current k8s-net-cilium.yml looks like this:

# k8s-net-cilium.yml
...
cilium_loadbalancer_ip_pools:
  - name: "blue-pool"
    cidrs:              
      - "10.0.10.0/24"
    ranges:             
      - start: "20.0.20.100"
        stop:  "20.0.20.200"
      - start: "1.2.3.4"
...

If we choose to use | to_yaml, it's need to be modified like this:

# k8s-net-cilium.yml
...
cilium_loadbalancer_ip_pools:
  - name: "blue-pool"
    cidrs:              
      - cidr: "10.0.10.0/24" # changed
    ranges:             
      - start: "20.0.20.100"
        stop:  "20.0.20.200"
      - start: "1.2.3.4"
...

Then the Jinja template(cilium-loadbalancer-ip-pool.yml.j2) can be simplified to:

# cilium-loadbalancer-ip-pool.yml.j2
...
blocks:
{{ cilium_loadbalancer_ip_pool.cidrs  | to_yaml | indent(2) }}
{{ cilium_loadbalancer_ip_pool.ranges | to_yaml | indent(2) }}
...

Both the current approach and this alternative work.
Let me know which one you think is better.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, let's not break compat. This is fine as is.

Copy link
Contributor

@VannTen VannTen left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

{% for rblock in cilium_loadbalancer_ip_pool.ranges | default([]) %}
- start: "{{ rblock.start }}"
stop: "{{ rblock.stop | default(rblock.start) }}"
{% endfor %}
{% endfor %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, let's not break compat. This is fine as is.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Kimcheolhui, tico88612, 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 12, 2025
@k8s-ci-robot k8s-ci-robot merged commit fceb151 into kubernetes-sigs:master May 12, 2025
46 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance Cilium LoadBalancer IP Pool Configuration: Support for Start-Stop Ranges
4 participants