Skip to content

Instantly share code, notes, and snippets.

@lwolf
Created September 16, 2017 10:21
Show Gist options
  • Save lwolf/561d9e4059d12897ca24b023c9db675d to your computer and use it in GitHub Desktop.
Save lwolf/561d9e4059d12897ca24b023c9db675d to your computer and use it in GitHub Desktop.
Error adding network: no IP addresses available in network: cbr0”
$ cd /var/lib/cni/networks/kubenet
$ ls
10.180.2.2 10.180.2.3 10.180.2.4 last_reserved_ip
$ echo foobar > 10.180.2.244
$ for hash in $(tail -n +1 * | grep '^[A-Za-z0-9]*$' | cut -c 1-8); do if [ -z $(docker ps -a | grep $hash | awk '{print $1}') ]; then grep -ir $hash ./; fi; done
./10.180.2.244:foobar
$ for hash in $(tail -n +1 * | grep '^[A-Za-z0-9]*$' | cut -c 1-8); do if [ -z $(docker ps -a | grep $hash | awk '{print $1}') ]; then grep -ilr $hash ./; fi; done | xargs rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment