You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Improving the locking system of the plugin, in order to get better performances.
Describe the solution you'd like
Instead of acquiring a lease on a shared object, each plugin instance could calculate a free IP address in advance and
then try to acuire a lease around it. This can be viewed as a sort of "optimistic IPAM".
Describe alternatives you've considered
The already implemented "Preallocated Node Slices" mechanism is an alternative, but it requires more components and moving part. This proposal only involves the CNI plugin itself.
Additional context
Following diagrams describes the differences between the actual approach (no preallocated slices) and the proposed one.
Regular whereabouts IP assignment
sequenceDiagram
activate PodA
PodA->>+Lease/whereabouts: acquire
rect rgb(191, 223, 255)
PodA->>IPPool: Get
PodA->>+PodA: findIP 192.168.1.1
PodA->>IPPool: Update +192.168.1.1
Lease/whereabouts-->>-PodA: release
deactivate PodA
end
activate PodB
PodB->>+Lease/whereabouts: acquire
rect rgb(191, 223, 255)
PodB->>IPPool: Get
PodB->>+PodB: findIP 192.168.1.2
PodB->>IPPool: Update +192.168.1.2
Lease/whereabouts-->>-PodB: release
deactivate PodB
end
The optimistic IP assignment, especially if adding a randomness in the address selection, should avoid having multiple CNI instances asking to lock the same Lease.
This flow diagram describes the main step of the approach:
flowchart TD
A["ipPool := k8s.IPPools().Get()"] -->B
B["ip := findAssignableIP(ipPool)"] --> C
C{"lease := k8s.Acquire('whereabouts_' + ip.String())"}
C -->|lease OK| E
C -->|"lease Timeout (~1s)"| F
E["k8s.Patch of ipPool.Allocations[ip.String()] = podRef"]
F["another whereabouts instance is assigning the same IP"] --> A
Loading
Feedback on this proposal is very welcome
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Improving the locking system of the plugin, in order to get better performances.
Describe the solution you'd like
Instead of acquiring a lease on a shared object, each plugin instance could calculate a free IP address in advance and
then try to acuire a lease around it. This can be viewed as a sort of "optimistic IPAM".
Describe alternatives you've considered
The already implemented "Preallocated Node Slices" mechanism is an alternative, but it requires more components and moving part. This proposal only involves the CNI plugin itself.
Additional context
Following diagrams describes the differences between the actual approach (no preallocated slices) and the proposed one.
Regular whereabouts IP assignment
Optimistic IP assignment
The optimistic IP assignment, especially if adding a randomness in the address selection, should avoid having multiple CNI instances asking to lock the same Lease.
This flow diagram describes the main step of the approach:
Feedback on this proposal is very welcome
The text was updated successfully, but these errors were encountered: