kubernetes/trouble shooting
[TroubleShooting] couldn't get current server API g roup list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080:
bbiyak2da
2024. 11. 9. 14:10
1. 오류 내용
azureuser@master:~$ kubectl get pods
E1109 05:07:28.258752 4356 memcache.go:265] couldn't get current server API g roup list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
2. 원인
kubernetes 클러스터 구축 후, 재접속 시 pod들을 불러오지 못 함
3. 해결 방법
kubectl 명령어는 ~/.kube/config 파일에 설정에 의해 작동되는데 해당 디렉토리에 config 파일이 존재하지 않았다.
- kubernetes 설정파일이 현재 아래의 경로에 있었다.
# kubernetes 설정파일 경로
/etc/kubernetes/admin.conf
- 아래 명령어로 해당 경로에 복사해주면 된다.
sudo cp /etc/kubernetes/admin.conf $HOME/.kube/config