"쿠버네티스 교과서"의 예제를 따라하다가 발생한 오류
m1맥 사용중
kubectl get nodes, kubectl get pods 에서 아래와 같은 오류가 나온다.
E0530 01:23:45.597873 26345 memcache.go:265] 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
E0530 01:23:45.600193 26345 memcache.go:265] 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
E0530 01:23:45.601150 26345 memcache.go:265] 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
E0530 01:23:45.602590 26345 memcache.go:265] 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
E0530 01:23:45.603279 26345 memcache.go:265] 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?
해결한 방법
1. lsof -i :6443으로 6443포트 사용중인 프로세스 다 끔
2. Docker Desktop은 켜져있다면 끄고 Rancher Desktop만 실행해야 함
Rancher Destop의 설정은 아래처럼
4. 터미널에 다음 명령어를 입력한다.
KUBECONFIG=$HOME/.kube/config
5. 해결
아직 쿠버네티스가 뭔지도 잘 모르겠는데,, 시작부터 오류들과 헤메다보니 머리가 너무 아프다