카테고리 없음

K8S The connection to the server localhost:8080 was refused

dodomp0114 2022. 11. 2. 12:12

우분투 환경에서 클러스트를 구성한 뒤에 

master node 에서 kubectl get pods 커멘더를 치면 나오게 되는 문구.

 

The connection to the server localhost:8080 was refused - did you specify the right host or port?

 

해당 메시지가 발생하는 경우는 보통 쿠버네티스 컨피그 파일이 $HOME/.kube 디렉토리 밑에 없거나, 현재 유저정보가 쿠버네티스 컨피그 파일에 반영되지 않은 경우에 발생.

 

root@master:~# mkdir -p $HOME/.kube
root@master:~# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
root@master:~# sudo chown $(id -u):$(id -g) $HOME/.kube/config

 

 

출처 : https://twofootdog.tistory.com/82