openshift-examples
openshift-examples copied to clipboard
failed to allocate for range 0: no IP addresses available in range set
Failed create pod sandbox: rpc error: code = Unknown desc = NetworkPlugin cni failed to set up pod "test-hunt-microservice-3-rpdqh_test-test" network: CNI request failed with status 400: 'failed to run IPAM for 065credacted96redacted31ce42c91878: failed to run CNI IPAM ADD: failed to allocate for range 0: no IP addresses available in range set: 10.128.0.1-10.128.1.254 '
111
possible reasons
- node running out of ipaddress
- cleanup of ips for dead pods is not properly done. (may be bug in older ocp versions)
debugging
check for timestamps here ls -l /var/lib/cni/networks/openshift-sdn/
Drain the node:
oc adm drain $node
systemctl stop atomic-openshift-node
rm -rf /var/lib/cni/networks/openshift-sdn/*
systemctl start atomic-openshift-node
oc adm uncordon $node
Also check https://github.com/cloudnativelabs/kube-router/issues/383. There is a (automatic) workaround using https://github.com/jsenon/api-cni-cleanup.
thanks @tobiasdenzler
Is there a built-in solution for this issue in Openshift 4 ? I have this issue in Openshift 4.7.
@donnydavis no clue.