Pod not in ready state after redeployment in tca. Error event found when describing the pod:
Warning FailedCreatePodSandBox 3m29s (x8866 over 3h58m) kubelet (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "################": plugin type="multus-cni-network" failed (add): [NameSpace/PodName/ethName]: error adding container to network "ethName": error at storage engine: Could not allocate IP in range: ip: #.#.#.#/ - #.#.#.# / range: net.IPNet{IP:net.IP{#,#,#,#}, Mask:net.IPMask{#,#,#,#}
TCA: 2.x, 3.1.1
TCP: 5.0
IP allocation issue with IP exhaustion in whereabouts
Clear up IP allocations in whereabouts by following these steps:
kubectl get pod -n namespace | grep -i <part-of-podname>kubectl get deployment -n <namespace>
if statefulset:
kubectl get statefulset -n <namespace>kubectl scale deployment -n <namespace> <name> --replicas=0
if statefulset:
kubectl scale statefulset -n <namespace> <name> --replicas=0
kubectl get overlappingrangeipreservations.whereabouts.cni.cncf.io -n whereabouts -o yaml | grep -C10 podnameCould not allocate IP in range: ip: #.#.#.#/ - #.#.#.#"kubectl get ippools.whereabouts.cni.cncf.io -Akubectl get ippools.whereabouts.cni.cncf.io -n <namespace><name> -o yamlkubectl get ippools.whereabouts.cni.cncf.io -n <namespace><name> -o yaml > ippool.yamlkubectl delete overlappingrangeipreservations.whereabouts.cni.cncf.io -n <namespace> #.#.#.#kubectl delete ippools.whereabouts.cni.cncf.io -n <namespace><name>kubectl rollout restart daemonset kube-multus-ds -n kube-system
kubectl rollout restart daemonset whereabouts -n kube-systemwatch -n 1 'kubectl get pods -A | grep <part of podname for statefulset/deployment>'If you have followed the steps above and it did not resolve the issue, validate the network-attachment-definitions to see if the ip exclusion is setup properly
kubectl get network-attachment-definitions -n namespace NADname -o yaml"exclude": ["#.#.#.#/#","#.#.#.#/#"]