-
Notifications
You must be signed in to change notification settings - Fork 121
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
Return the allocated IP to a pod with the same namespace/name #446
Conversation
fix #176 |
@andreaskaris PTAL |
05fdcde
to
06dae29
Compare
ContainerID: containerID, | ||
PodRef: podRef, | ||
} | ||
_, err = c.client.WhereaboutsV1alpha1().OverlappingRangeIPReservations(c.namespace).Update( |
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.
wrap in retry?
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 will return an error and fail the CNI call. So kubelet will retry the CNI call. Additionally, we don't have the retry for other API calls either. Therefore, if we want to implement a retry logic, we shall address it comprehensively.
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.
yeah o.k. I misunderstood this anyway given that it's a CNI plugin it doesn't make a lot of sense
Looks o.k. to me but I'm horrible at reviewing without actually testing the code. If I have time I'll test this tomorrow, but IMO this looks simpler (and thus better) than the earlier approach |
I tried to surf around the history to figure out if there was a reason we didn't use podRef, but, I can't find any smoking gun. I think this approach of switching to base on podRef is an improvement, thanks. Thanks Peng for the PR, and Andreas for the review, as well. |
Pull Request Test Coverage Report for Build 8612252580Details
💛 - Coveralls |
For statefulset pods, it will reuse the pod names after a node reboot. Whereabouts shall always return the same IP address that has already been allocated, when the pods start. Signed-off-by: Peng Liu <pliu@redhat.com>
When a pod references multiple virtual function interfaces and all are allocated addresses, they will all be assigned the same address. |
Yeah, it is a limitation when you have a pod with multiple interfaces using the same IP range. A workaround is to divide the IP range into sections and assign different ranges to each interface of the pod. If we want to fix that, we need to update the API to store interface names. So that we can identify the IP allocation per interface. @dougbtv @andreaskaris @maiqueb WDYT |
I'm trying to reproduce https://issues.redhat.com/browse/OCPBUGS-29648 or #176 with upstream/master whereabouts on kind, to get a baseline for my testing. |
@andreaskaris I couldn't reproduce with a kind cluster either. I reproduced it with OCP. |
I just tested the WRT attaching the same network 2x:
I get:
That's indeed a regression to how it worked before, though:
|
For statefulset pods, it will reuse the pod names after a node reboot. Whereabouts shall always return the same IP address that has already been allocated, when the pods start.
This patch also changes the IP deallocation logic. Now, the allocation record is identified by podRef instead of containerID.