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
ipam/multipool: Introduce specific ip family annotations for specifying ip pools #28244
ipam/multipool: Introduce specific ip family annotations for specifying ip pools #28244
Conversation
bfed145
to
91b8c0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, looks good overall. Thanks for taking care of this!
I've left some minor feedback about the code itself.
00703b5
to
0abae38
Compare
Commit dd6cdc950f0f7378d61cb66d79413f14b935a81e does not match "(?m)^Signed-off-by:". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
dd6cdc9
to
0abae38
Compare
0abae38
to
86b847b
Compare
Thanks! I have made the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, looks good! One remaining minor suggestion
86b847b
to
cc7213b
Compare
274edee
to
a5e3b6b
Compare
Thank you. I made the changes. Please let me know if there are any other issues. Appreciate your guidance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last suggestion, then it should be good to go!
a5e3b6b
to
a1d53c8
Compare
This adds two annotations, "ipam.cilium.io/ipv4-pool" and "ipam.cilium.io/ipv6-pool". The former can be added to pods or namespaces to specify an IPv4 pool for workloads, while the latter corresponds to specifying an IPv6 pool for workloads. Signed-off-by: Huagong Wang <wanghuagong@kylinos.cn>
Now, it will first check if the pod has annotations ipam.cilium.io/ipv4-pool or ipam.cilium.io/ipv6-pool; if so, it will return the pool from the specific IP family. If these annotations are not present, it will check if the pod has the annotation ipam.cilium.io/ip-pool, and if found, it will return the pool as usual. If the pod doesn't have any annotations, it will then check if the namespace in which the pod resides has these annotations in the same order. If neither the pod nor the namespace has these annotations, it will return the default IP pool. Signed-off-by: Huagong Wang <wanghuagong@kylinos.cn>
a1d53c8
to
19bd9c2
Compare
Thank you for your guidance and thoughtful suggestions. Much appreciated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/test |
@tommyp1ckles PTAL |
In dual-stack mode, it's necessary to allocate both IPv4 and IPv6 addresses for pods. However, custom IP pools may only focus on either IPv4 or IPv6, which can result in the custom IP pool being configured with only IPv4 or IPv6. When specifying an IP pool for a namespace or pod through annotations, this can cause pod creation to fail because the specified IP pool lacks the IPv4 or IPv6 family.
This PR introduces two IP-family specific annotations: ipam.cilium.io/ipv4-pool and ipam.cilium.io/ipv6-pool. When specifying pools for pods or namespaces, combining these annotations allows for handling more scenarios.
This PR covers the use cases mentioned here #28204 (comment) and has been implemented based on the suggestions here #28204 (review).