Open ugur99 opened 1 month ago
Hi @ugur99 thanks for the suggestion! How do you see the metric? Node name, IP range size, # of consumed IPs?
hey @mneverov sorry for my late response!
We could scan all defined ClusterCIDRs
to identify unique IP ranges. The controller should recalculate these whenever ClusterCIDRs
are created or deleted.
For each unique IP range, we could calculate the total allocated IPs across nodes and generate an usage metric. This would allow us to expose metrics for each unique IP range.
Assuming we have two unique IP ranges, the metrics could look like this:
node_ipam_cidr_usage_percentage{cidr="10.0.0.0/16"} 0.25
node_ipam_cidr_usage_percentage{cidr="192.168.0.0/16"} 0.80
Not sure how much complexity this would add to the codebase, but would be great to have such metrics.
we already have those values https://github.com/kubernetes-sigs/node-ipam-controller/blob/437086557076b8714619b5b1f934d1ac28997a96/pkg/controller/ipam/multicidrset/multi_cidr_set.go#L32-L59 so it should be straighforward to add those metrics,
/kind feature
Hi! I've checked the source code and it seems that there are some metrics planned to be served; but if I'm not mistaken those are not yet served. Are there any plans to improve metrics setup?
Also I was thinking that maybe it would be nice if we add another metric that shows the total ip range usage for each unique ip pool defined in the ClusterCIDR resources.