Skip to content

Instantly share code, notes, and snippets.

@dougbtv
Created June 24, 2021 15:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dougbtv/076d63f5204a35d65ab4952e77199d56 to your computer and use it in GitHub Desktop.
Save dougbtv/076d63f5204a35d65ab4952e77199d56 to your computer and use it in GitHub Desktop.
Whereabouts clear IP allocations

Clearing IP allocations manually with Whereabouts

This outlines a process for clearing IP address allocations with Whereabouts manually. This clears all allocations, you could be more surgical about it, however, this is efficient if it's possible.

NOTE I have another procedure somewhere which has fancy bash commands to make this easier, and is fully tested, however, in theory this "should just work" (you've heard that before)

Overview

  1. Stop all pods which use Multus + Whereabouts (if possible)
  2. Clear IP allocations
  3. Start any pods which use Multus + Whereabouts.

Step 1 and 3 are hopefully intuitive and are done in order to avoid possible inconsistencies.

For step 2:

oc get crds | grep -i whereabouts

This should result in two CRDs, overlappingrangeipreservations.whereabouts.cni.cncf.io and ippools.whereabouts.cni.cncf.io

For each of those, perform:

oc get overlappingrangeipreservations.whereabouts.cni.cncf.io -A

and then with each item there.

oc delete $names-from-above -n $namespace-here

Repeat with ippools.whereabouts.cni.cncf.io

@jeniferh
Copy link

Thanks Doug! This worked great, one nit the oc delete needs the crd name. Here is a quick way I deleted the bunch:
oc delete overlappingrangeipreservations.whereabouts.cni.cncf.io ` oc get overlappingrangeipreservations.whereabouts.cni.cncf.io -A | awk '{print "-n",$1," ",$2}'`

@dougbtv
Copy link
Author

dougbtv commented Jul 16, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment