Failed to start container with kubectl

I am learning kubernetes and using minikube to create a single node cluster in my ubuntu machine. Oracle Virtualbox is also installed in my ubuntu machine. When I ran

$ minikube start

Starting local Kubernetes v1.6.4 cluster...
...

$ cat ~/.kube/config

apiVersion: v1
clusters:
- cluster:
    certificate-authority: /root/.minikube/ca.crt
    server: https://192.168.99.100:8443
  name: minikube
... 

$ kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8000

error: failed to discover supported resources: Get https://192.168.99.100:8443/api: Service Unavailable

      

I don't understand what is causing this error. Is there some place to check the logs. I cannot use kubectl logs as it requires the container to mention that it is not being created at all. Please provide any possible solution to the problem.

+3


source to share


1 answer


You can debug with the following steps:



  • kubectl

    talks to kube-apiserver

    on port 8443 to complete his task. Give it a try curl -k https://192.168.99.100:8443

    and see if there is a positive answer. If it fails, it means it kube-apiserver

    doesn't work at all. You can try restarting the virtual machine or rebuilding the minicube to make sure it fits correctly a second time.

  • You can also debug the virtual machine directly if you think you're brave. In this case, get a shell on a virtual machine deployed by a minicube. Run docker ps | grep apiserver

    to check if the module is running kube-apiserver

    . Also try ps aux | grep apiserver

    checking if it starts up initially. If both results do not appear, check the logs with journalctl -xef

    .

+1


source







All Articles