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: report IP owner of non-default pool IPs in multi-pool IPAM #27968
Conversation
/test |
Before this change, only IPs from the default pool are reported in `cilium status --verbose` in the "Allocated addresses" section when using multi-pool IPAM mode. With this change, all IPs from non-default pools are reported as well by making use of the fact that the pool name is prepended to the IP in `(*multiPoolManager).dump`. Example: ``` % ks exec -it cilium-n8xw7 -- cilium status --verbose [...] IPAM: IPv4: 2 IPAM pool(s) available, Allocated addresses: 10.10.0.46 (router) 10.10.0.48 (kube-system/coredns-5d78c9869d-d4nts [restored]) 10.10.0.61 (kube-system/hubble-relay-597b7bdff8-pwl69 [restored]) 10.10.0.62 (health) jupiter/192.168.0.15 (default/nginx-jupiter) [...] ``` Note that IPs from non-default pools (in this case the `jupiter` pool) are reported with the pool name prefixed. Signed-off-by: Tobias Klauser <tobias@cilium.io>
bad7657
to
35daa4d
Compare
/test |
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 for fixing this. Have you also considered changing the type of the IPv4Allocator.Dump()
interface to store the pool name separately? To my knowledge, the Allocator
interface (where Dump
is a part of) while exported is actually not used outside the IPAM package, so I think we should consider changing the signature of ipam.Allocator.Dump
to contain the pool name if possible.
The ipam.IPAM.Dump
signature can remain as is, I would only change ipam.Allocator.Dump
so we can transport the information without having to split strings.
Thanks for the suggestion. I haven't considered this so far but it would make the interface a lot cleaner. I'd probably defer that change to a follow-up PR, so this rather small PR can be backported (given it adds additional debugging/tourbleshooting information for multi-pool IPAM) without much internal API refactoring. |
Before this change, only IPs from the default pool are reported in
cilium status --verbose
in the "Allocated addresses" section when using multi-pool IPAM mode. With this change, all IPs from non-default pools are reported as well by making use of the fact that the pool name is prepended to the IP in(*multiPoolManager).dump
.Example:
Note that IPs from non-default pools (in this case the
jupiter
pool) are reported with the pool name prefixed.For #25470