Skip to main content

워커노드 kubectl TroubleShoot

에러 내용

워커노드에서 kubectl get nodes 실행시 아래와 같은 에러 발생

$ kubectl get nodes
E0122 16:07:04.794739 2045454 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
E0122 16:07:04.795160 2045454 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
E0122 16:07:04.796682 2045454 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
E0122 16:07:04.798083 2045454 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
E0122 16:07:04.799420 2045454 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?
  • 쿠버네티스 컨피그 파일이 $HOME/.kube 디렉토리 아래 존재하지 않을 때
  • 현재 유저정보가 쿠버네티스 컨피그 파일에 반영되지 않은 경우에 발생
mkdir -p $HOME/.kube
# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo cp -i /etc/kubernetes/kubelet.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config