본문 바로가기

컨테이너/Kubernetes

Error: INSTALLATION FAILED: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused 해결 방법

Error: INSTALLATION FAILED: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused 에러 해결 방법

 

클러스터에 엑세스 하기 위해서는 KUBECONFIG라는 환경 변수를 Kubernetes 구성 파일의 경로로 설정을 해주어야 한다.

따라서 아래와 같은 명령을 통해 외부에서 클러스터에 접근할 수 있도록 설정해준다.

 

export KUBECONFIG=/etc/rancher/k3s/k3s.yaml

 

위 명령어를 실행하면 해당 에러가 해결되었다.

 

 

 

 

참고 : https://docs.k3s.io/cluster-access

 

Cluster Access | K3s

The kubeconfig file stored at /etc/rancher/k3s/k3s.yaml is used to configure access to the Kubernetes cluster. If you have installed upstream Kubernetes command line tools such as kubectl or helm you will need to configure them with the correct kubeconfig

docs.k3s.io