Rate This Document
Findability
Accuracy
Completeness
Readability

Pod Always in ContainerCreating State When Starting Pod on Node

Symptom

When the kubectl get pod -o wide command is run, it is shown that the pod status is always ContainerCreating.

View the log. The following information is displayed in the log:

network: failed to set bridge addr: "cni0" already has an IP address different from 10.244.2.1/24

Key Process and Cause Analysis

The node has been repeatedly added to the cluster.

Conclusion and Solution

  1. Perform the following operations on the node:
    kubeadm reset
    systemctl stop kubelet
    systemctl stop docker
    rm -rf /var/lib/cni/
    rm -rf /var/lib/kubelet/*
    rm -rf /etc/cni/
    ifconfig cni0 down
    ifconfig flannel.1 down
    ifconfig docker0 down
    ip link delete cni0
    ip link delete flannel.1
    systemctl start docker
  2. Run the kubeadm join command on the node again to add the node to the cluster.
  3. Create containers in the Pod again.