For example when I use kubectl get pods
the response is:
No resources found in default namespace.
But when I use sudo kubectl get pods
the result is:
E1211 12:01:15.409201 50965 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E1211 12:01:15.409569 50965 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E1211 12:01:15.411086 50965 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E1211 12:01:15.412633 50965 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E1211 12:01:15.414189 50965 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?
PS: From my previous knowledge I think when I use kubectl
without sudo
, it refers to 192.168.1.2:6443
but with the sudo
word it is looking for localhost:8080
. I don't know why?