본문 바로가기

Cloud/EKS

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

EKS 실습중 

Kubeclt get nodes 불가 

$ sudo kubectl get nodes
The connection to the server localhost:8080 was refused - did you specify the right host or port?

 

sudo 빼고하면 permision 문제 발생

 

$ mkdir -p $HOME/.kube
$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
$ sudo chown $(id -u):$(id -g) $HOME/.kube/config
$ export KUBECONFIG=/etc/kubernetes/admin.conf

-------- root cause:
$ export KUBECONFIG=/etc/kubernetes/admin.conf
the owner of /etc/kubernetes/admin.conf is root.

------- workaround:
$ export KUBECONFIG=$HOME/.kube/config

 

해봤으나.......... 

작동안됨. 

aws eks update-kubeconfig --region ap-northeast-2 --name test-eks-cluster
Updated context arn:aws:eks:ap-northeast-2XXXXX:cluster/test-eks-cluster in /home/ubuntu/admin.conf

 

Cluster in /home/ubuntu/admin.conf .......흠

바꿔서 폴더 복사해보았으나 .. 

 

결국 새로 다시 설치함.

'Cloud > EKS' 카테고리의 다른 글

Terraformer 기존 EKS Autoscaling 자원 대상 IaC 코드 추출  (0) 2022.04.23
aws eks  (0) 2022.04.23
Terraformer install  (0) 2022.04.17
Kubectl 클린 Uninstall  (0) 2022.04.12