# Kubectl cannot reach API server

**URL:** https://forums.suse.com/t/kubectl-cannot-reach-api-server/40171
**Category:** k3s, k3OS, and k3d
**Created:** [March 3, 2023, 6:37pm UTC](https://forums.suse.com/t/kubectl-cannot-reach-api-server/40171 "2023-03-03T18:37:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Alexander2](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/alexander2/32/9897_2.png) [@Alexander2](https://forums.suse.com/u/Alexander2)
#### Post date: [March 3, 2023, 6:37pm UTC](https://forums.suse.com/t/kubectl-cannot-reach-api-server/40171/1 "2023-03-03T18:37:10Z")

</div>

Hello everybody,  
I hope anybody knows wtf I am having here.

so, I try to install k3s cluster locally on my virtual machine for testing purposes.  
I follow instrustions from official site and run simple curl one-string command. Everything is ok and systemd service created and started.  
But when I try to get list of nodes by means of kubectl, I get the following :

```auto
 ⚡ root@012030123  ~  kubectl get nodes
E0303 20:49:32.862472 6583 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0303 20:49:32.863920 6583 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0303 20:49:32.865714 6583 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0303 20:49:32.867943 6583 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0303 20:49:32.868954 6583 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?

```

The only thing I could find in archwiki is that I need to create a symlink

```auto
ln -rsf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

```

but this didnt help.

I guess kubectl is trying to reach API server by IPv6 but have no idea why it doesnt use 127.0.0.1 as it is described in k3s,yaml in /etc/rancher/k3s/ directory.

In the same time, I have tested absolutely the same on Ubuntu and it works without any tricks. So I would suppose that something needs to be done additionally in Arch.

Any help is apprecciated. In advance I am sending to all of you rays of happiness.
