https://rancher.com/ logo
Title
r

rough-barista-65361

07/30/2022, 7:38 AM
Hi Everyone, Please advise how to overcome this error while installing the agent in the k3s Kubernetes cluster. ubuntu@k3s-master:~$ sudo k3s kubectl get node NAME STATUS ROLES AGE VERSION k3s-worker-1 Ready <none> 3h25m v1.24.3+k3s1 k3s-worker-2 Ready <none> 3h25m v1.24.3+k3s1 k3s-master Ready control-plane,master 3h27m v1.24.3+k3s1 ubuntu@k3s-master:~$ sudo k3s kubectl get namespace NAME STATUS AGE kube-system Active 3h27m default Active 3h27m kube-public Active 3h27m kube-node-lease Active 3h27m ubuntu@k3s-master:~$ Error: INSTALLATION FAILED: Kubernetes cluster unreachable: Get “http://localhost:8080/version”: dial tcp [::1]:8080: connect: connection refused
c

creamy-pencil-82913

07/30/2022, 7:43 AM
What is that error even from? That's not an error k3s or kubectl would give you. It mostly just looks like you haven't given something the path the the k3s admin kubeconfig?
r

rough-barista-65361

07/30/2022, 7:46 AM
Thanks @creamy-pencil-82913 agree can you please guide how to configure in path k3s admin kubeconfig.
thanks in advance
f

freezing-summer-64950

07/30/2022, 5:27 PM
Make sure your K3s.yaml matches your config file in ~/.kube/config and chmod 644 both files. also try export KUBECONFIG=/etc/rancher/k3s/k3s.yaml or where ever your config/k3s.yaml file is located...then your kubectl command should interact with k3s server if that doesn't work them restart your k3s server and run this command: export KUBECONFIG=/etc/rancher/k3s/k3s.yaml or where ever your config file is
👍 1
FYI I had the same error and I had to do this to troubleshoot
r

rough-barista-65361

07/30/2022, 5:32 PM
Thanks Bryan, may I request you please share reference link/article that I can follow
c

creamy-pencil-82913

07/30/2022, 8:30 PM
r

rough-barista-65361

07/31/2022, 3:53 AM
Thanks @creamy-pencil-82913 it helped. cheers mate
c

careful-article-61190

11/16/2022, 1:07 AM
@creamy-pencil-82913 getting same error from worker node, so k3s.yaml is missing in worker node i only see this config.yaml.d registries.yaml
@creamy-pencil-82913 what could be the issue ?
Can i copy file from master node and use on worker node ?