Calico IPAM Allocation Algorithm

Calico IPAM Allocation Algorithm A workflow diagram generated by Archify. 01 / Pod creation 02 / Step 1 · Node affine block 03 / Step 2 · Claim new block 04 / Step 3 · Borrow from other nodes EX / IP exhaustion Pod creation request · CNI ADD → Calico IPAM · Pod creation Pod creation request CNI ADD → Calico IPAM Free IP in affine block? · blocks affine to this node · Step 1 · Node affine block Free IP in affine block? blocks affine to this node Allocate IP · assign pod IP from the block · Step 1 · Node affine block Allocate IP assign pod IP from the block IP assigned · pod gets its IP · Step 1 · Node affine block IP assigned pod gets its IP Free block in pool? · unclaimed blocks in IPPool CIDR · Step 2 · Claim new block Free block in pool? unclaimed blocks in IPPool CIDR Claim a new block · node affinity · blockSize /26 · Step 2 · Claim new block Claim a new block node affinity · blockSize /26 Free IP on other nodes? · scan non-affine blocks · Step 3 · Borrow from other nodes Free IP on other nodes? scan non-affine blocks Borrow IP · IP from a non-affine block · Step 3 · Borrow from other nodes Borrow IP IP from a non-affine block Allocation failed · IP exhaustion · pod creation fails · IP exhaustion Allocation failed IP exhaustion · pod creation fails yes no yes no yes no Legend Start / end Decision Allocation failed Block / IP allocation