Skip to content

Conversation

@tamilmani1989
Copy link
Member

@tamilmani1989 tamilmani1989 commented Feb 17, 2023

Reason for Change:

This PR fixes duplicate ip assignment to pods if cns looksup/updates podinfo cache based on pod name and namespace. This PR updates to lookup based on containerid instead if managedendpointstate is set.

  • containerd invokes cni with containerid say "c1" and cni allocates ip from cns and returns success but something failed in containerd and it issues add with new container id say "c2" for same pod before calling delete with "c1"
  • cni receives add for same pod with "c2" containerid and request cns to allocate ip and cns returns an available ip and marks it allocated
  • cni receives del for same pod with "c1" containerid and request cns to release ip allocated for "c1" container id but since cns keeps pod name + namespace as key in-memory cache it may release ip allocated for containerid "c2"
  • cni receives add for some other pod and cns may endup assigning same ip to this pod but cilium agent has a check to catch these duplicate ip assignment and throw error and cni add call will be retried

Issue Fixed:

Requirements:

Notes:

@tamilmani1989 tamilmani1989 requested a review from a team as a code owner February 17, 2023 21:29
@tamilmani1989 tamilmani1989 requested review from rbtr and removed request for a team February 17, 2023 21:29
@tamilmani1989 tamilmani1989 added cns Related to CNS. fix Fixes something. labels Feb 17, 2023
@tamilmani1989 tamilmani1989 merged commit 96835dc into master Feb 21, 2023
@tamilmani1989 tamilmani1989 deleted the tamanoha/cnsInMemoryKeyFix branch February 21, 2023 20:04
rjdenney pushed a commit that referenced this pull request Mar 13, 2023
…enabled (#1811)

update podInfo key as containerid instead of name and namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cns Related to CNS. fix Fixes something.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants