Error while running kubectl commands

7/8/2016

I have recently installed minikube and kubectl. However when I run kubectl get pods or any other command related to kubectl I get the error

Unable to connect to the server: unexpected EOF

Does anyone know how to fix this?I am using Ubuntu server 16.04.Thanks in advance.

-- rmb
kubernetes

2 Answers

10/24/2017

The following steps can be used for further debugging.

  1. Check the minikube local cluster status using minikube status command.

     $: minikube status
     minikube: Running
     cluster: Running
     kubectl: Correctly Configured: pointing to minikube-vm at 172.0.x.y
  2. If problem with kubectl configuratuion,then configure it using, kubectl config use-context minikube command.

    $: kubectl config use-context minikube
    Switched to context "minikube".
  3. Check the cluster status, using kubectl cluster-info command.

    $: kubectl cluster-info
    Kubernetes master is running at ...
    Heapster is running at ...
    KubeDNS is running at ...
    ...
    To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Note: It can even be due to very simple reason: internet speed (it happend to me just now).

-- codenio
Source: StackOverflow

8/23/2016

I think your kubernetes master is not setup properly. You can check that by checking the following services in master node are in active state and running.

etcd2.service 
kube-apiserver.service          Kubernetes API Server
kube-controller-manager.service Kubernetes Controller Manager
kube-scheduler.service          Kubernetes Scheduler 
-- Irham Iqbal
Source: StackOverflow