Minikube stuck while creating container

I recently started learning Kubernetes using Minikube locally on my Mac. Previously, I was able to start a local Kubernetes cluster with Minikube 0.10.0, created a deployment, and looked at the Kubernetes toolbar.

Yesterday I tried to remove the cluster and redo everything from scratch. However, I found that I could not deploy assets and could not view the panel. From what I saw, everything seemed to get stuck while creating the container.

After I launched minikube start , it reported

 Starting local Kubernetes cluster... Kubectl is now configured to use the cluster. 

When I ran kubectl get pods --all-namespaces , it reported (note the STATUS column):

 kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE kube-system kube-addon-manager-minikube 0/1 ContainerCreating 0 51s 

docker ps didn't show anything:

 docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 

minikube status tells me that the VM and cluster are running:

 minikubeVM: Running localkube: Running 

If I tried to create a deployment and autoscaler, I was told that they were successfully created:

 kubectl create -f configs deployment "hello-minikube" created horizontalpodautoscaler "hello-minikube-autoscaler" created $ kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE default hello-minikube-661011369-1pgey 0/1 ContainerCreating 0 1m default hello-minikube-661011369-91iyw 0/1 ContainerCreating 0 1m kube-system kube-addon-manager-minikube 0/1 ContainerCreating 0 21m 

When exhibiting the service, he said:

 $ kubectl expose deployment hello-minikube --type=NodePort service "hello-minikube" exposed $ kubectl get service NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello-minikube 10.0.0.32 <nodes> 8080/TCP 6s kubernetes 10.0.0.1 <none> 443/TCP 22m 

When I tried to access the service, they told me:

 curl $(minikube service hello-minikube --url) Waiting, endpoint for service is not ready yet... 

docker ps still didn't show anything. It seemed to me that everything was stuck when creating the container. I tried other ways to get around this problem:

  • Upgraded to minikube 0.11.0
  • Use xhyve driver instead of Virtualbox driver
  • Delete all cached files, e.g. ~ / .minikube, ~ / .kube and the cluster, and try again

None of them worked for me.

Kubernetes is still a beginner, and I would like to know:

  • How to fix this problem?
  • What could be causing this problem?

Any help is appreciated. Thanks.

+7
kubernetes minikube
source share
5 answers

In my case, it turned out to be a network problem.

The pod status is "ContainerCreating", and I found that when creating the container, the docker image will be displayed from gcr.io, which is not available in China (blocked by GFW). In the past, this worked for me because I had a chance to connect to the VPN.

+3
source share

I have not tried minikube, but I use tunnels. With the information provided it is difficult to say the cause of the problem. Your mini-cube has no problems creating resources, but ContainerCreating is a problem with docker daemons or a bad connection between the api cube and the docker daemon or some problems with kubelet.

You can try kubectl to describe po POD_NAME . This will give you events. Perhaps this will provide a path to the root cause of the problem.

OR

check kubelet logs for events.

+3
source share

A horizontal pointer (hpa) requires the use of a hipster. To do this, you need to run the forge in a mini-cube. You can always debug these problems using minikube logs or interactively through the dashboard found in the minikube dashboard .

You can find steps to run heapster and grafana at https://github.com/kubernetes/heapster

0
source share

For me, these are serral mins before I understand the problems of ContainerCreating . After executing cmd systemctl status kube-controller-manager.service , I get an error

Synchronizing "default / redis-master-2229813293" failed because containers could not be created: the API token for the default service account was not found, try again after the token is automatically created and added to the service account.

So, two ways to solve:

  • setting up a service account using a token
  • remove the ServiceAccount KUBE_ADMISSION_CONTROL parameter in the api server
0
source share

I had this problem on Windows, but it was related to the NTLM proxy. I uninstalled the minikube virtual machine and then recreated it with the correct proxy settings for my CNTLM installation:

 minikube start --docker-env http_proxy=http://10.0.2.2:3128 --docker-env https_proxy=http://10.0.2.2:3128 --docker-env no_proxy=localhost,127.0.0.1,::1,192.168.99.100 

See https://blog.alexellis.io/minikube-behind-proxy/

0
source share

All Articles