Kubectl connectivity issue

2/9/2019

I installed first ectd, kubeapiserver and kubelet using systemd service. The services are running fine and listening to all required ports.

When I run kubectl cluster-info , I get below output

Kubernetes master is running at http://localhost:8080

When I run kubectl get componentstatuses, then I get below output

etcd-0               Healthy     {"health": "true"}

But running kubectl get nodes , I get below error

Error from server (ServerTimeout): the server cannot complete the requested operation at this time, try again later (get nodes)

Can anybody help me out on this.

-- Rehan Ch
kubectl
kubernetes

2 Answers

2/9/2019

What is the status of controller manager and scheduler. Do you see them listed as Healthy when you run the below command

kubectl get cs
-- P Ekambaram
Source: StackOverflow

2/9/2019

Your missing kubeconfig file. kubectl looks config file in this location $HOME/.kube/config

Part of install you can copy config file like this on master node.

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
-- sfgroups
Source: StackOverflow