skip to Main Content

I have setup the Kubernetes cluster with Kubespray
enter image description here

Once I restart the node and check the status of the node I am getting as below

$ kubectl get nodes
  The connection to the server 127.0.0.1:6443 was refused - did you specify the right host or port?

enter image description here


Environment:

OS : CentOS 7
Kubespray
kubelet version: 1.22.3

Need your help on this.

Regards,
Zain

3

Answers


  1. Chosen as BEST ANSWER

    Thank you Sai for your inputs. i was getting journalctl -xeu kubelet output was Error while dialing dial unix /var/run/cri-dockerd.sock: connect: no such file or directory i was restarted and enabled cri-dockerd services

    • sudo systemctl enable cri-dockerd.service
    • sudo systemctl restart cri-dockerd.service

    then sudo systemctl start kubelet finally it works for me.

    #kubectl cluster-info Kubernetes control plane is running at https://127.0.0.1:6443

    this link will give https://github.com/kubernetes-sigs/kubespray/issues/8734 more info. Regards,Zain


  2. Below step can solve your issue.
    kubelet may be down, use the below commands on the master node.

       1. sudo -i
    
       2. swapoff -a
    
       3. exit
    
       4. strace -eopenat kubectl version
    

    Then try using kubectl get nodes.

    Login or Signup to reply.
  3. This work for me, I’m using minukube,

    When checking the minikube status by running the command minikube status you’ll probably get something like that

        E0121 07:14:19.882656    7165 status.go:415] kubeconfig endpoint: got: 
        127.0.0.1:55900, want: 127.0.0.1:49736
    
        type: Control Plane
        host: Running
        kubelet: Stopped
        apiserver: Stopped
        kubeconfig: Misconfigured
    

    To fix it, I just followed the next steps:

    1. minikube update-context
    2. minukube start
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search