kube-apiserver pod sticks in the CreateContainerError status kube-apiserver pod sticks in the CreateContainerError status kubernetes kubernetes

kube-apiserver pod sticks in the CreateContainerError status


The issue is explained by this error message from docker daemon:

message: 'Error response from daemon: Conflict. The container name "/k8s_kube-apiserver_kube-apiserver-master_kube-system_ce0f74ad5fcbf28c940c111df265f4c8_24" is already in use by container 14935b714aee924aa42295fa5d252c760264d24ee63ea74e67092ccc3fb2b530. You have to remove (or rename) that container to be able to reuse that name.' reason: CreateContainerError

List all containers using:

docker ps -a

You should be able to find on the list container with following name:

/k8s_kube-apiserver_kube-apiserver-master_kube-system_ce0f74ad5fcbf28c940c111df265f4c8_24

or ID:

14935b714aee924aa42295fa5d252c760264d24ee63ea74e67092ccc3fb2b530

Then you can try to delete it by running:

docker rm "/k8s_kube-apiserver_kube-apiserver-master_kube-system_ce0f74ad5fcbf28c940c111df265f4c8_24"

or by providing its ID:

docker rm 14935b714aee924aa42295fa5d252c760264d24ee63ea74e67092ccc3fb2b530

If there is still any problem with removing it, add the -f flag to delete it forcefully:

docker rm -f 14935b714aee924aa42295fa5d252c760264d24ee63ea74e67092ccc3fb2b530

Once done that, you can try to delete kube-apiserver-master pod, so it can be recreated.