debianmaster / openshift-examples

Openshift Examples - This repo does not provide end to end example but rather act as a rough draft for my work. use with caution. Buzzme at @twitter
https://twitter.com/debianmaster
280 stars 290 forks source link

failed to allocate for range 0: no IP addresses available in range set #59

Open debianmaster opened 6 years ago

debianmaster commented 6 years ago

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
debianmaster commented 6 years ago

possible reasons

  1. node running out of ipaddress
  2. 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
tobiasdenzler commented 5 years ago

Also check https://github.com/cloudnativelabs/kube-router/issues/383. There is a (automatic) workaround using https://github.com/jsenon/api-cni-cleanup.

debianmaster commented 5 years ago

thanks @tobiasdenzler

Dorsosiv commented 3 years ago

Is there a built-in solution for this issue in Openshift 4 ? I have this issue in Openshift 4.7.

debianmaster commented 3 years ago

@donnydavis no clue.