😭쿠버네티스 설치 후
kubectl get nodes
실행시 아래와 같은 에러가 발생한다면
...생략
couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
...생략
아래 명령어를 실행해주시면 됩니다.
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/kubelet.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
🫠위 명령어를 통해
Kubernetes
클러스터와 상호 작용하기 위한 설정 파일을 사용자의 홈 디렉토리에 저장하게 됩니다.위 과정을 거친 후 다시
kubectl get nodes
를 치신다면 제대로 나오는 것을 확인 할 수 있습니다.