openshift-examples icon indicating copy to clipboard operation
openshift-examples copied to clipboard

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

Open debianmaster opened this issue 7 years ago • 5 comments

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 avatar May 02 '18 06:05 debianmaster

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

debianmaster avatar May 02 '18 06:05 debianmaster

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

tobiasdenzler avatar Nov 26 '18 08:11 tobiasdenzler

thanks @tobiasdenzler

debianmaster avatar Nov 26 '18 12:11 debianmaster

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

Dorsosiv avatar Aug 16 '21 15:08 Dorsosiv

@donnydavis no clue.

debianmaster avatar Aug 16 '21 15:08 debianmaster