-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: support allocating IP with index from node chunk #55
feat: support allocating IP with index from node chunk #55
Conversation
pkg/cni/types/types.go
Outdated
if len(n.IPAM.RequestedIPs) > 0 { | ||
return nil, fmt.Errorf("allocateIPWithIndex can't be used together with static IP request") | ||
} | ||
if n.IPAM.Features.AllocateDefaultGateway { |
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.
It looks like we will never reach this code. This condition is already handled on line 209
pkg/ipam-node/handlers/allocate.go
Outdated
} | ||
|
||
// IPOffsetBy returns the IP that is offseted by index from the given IP | ||
func IPOffsetBy(ip net.IP, index int32) net.IP { |
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.
Let's use this one
nvidia-k8s-ipam/pkg/ip/cidr.go
Line 35 in 6649bfc
func NextIPWithOffset(ip net.IP, offset int64) net.IP { |
This feature enables us to allocate the IP that is offset by index from the start of the range allocated for a particular node using CNI args. It is useful when a particular workload that runs as DaemonSet wants to allocate always the same IP, even if it's recreated. Signed-off-by: Vasilis Remmas <[email protected]>
cb88c3f
to
9d75e01
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.
LGTM
This feature enables us to allocate the IP that is offset by index from the start of the range allocated for a particular node using CNI args. It is useful when a particular workload that runs as DaemonSet wants to allocate always the same IP, even if it's recreated.