kubectl 다중 클러스터 접근 구성(aws eks)
kubectl 다중 클러스터 접근 구성(aws eks)
먼저 aws cli를 설치해야 된다.
aws configure
AWS Access Key ID [None]: 본인 Access Key
AWS Secret Access Key [None]: 본인 Secret Access Key
Default region name [None]: ap-northeast-2
Default output format [None]: json
설치후에 eks 접속 권한이 있는 key와 secret을 설정해야 된다.
aws eks --region $REGION update-kubeconfig --name $CLUSTER_NAME
aws eks --region ap-northeast-2 update-kubeconfig --name test-eks
위에 commend를 설정 하면 kubeconfig를 업데이트 하게 된다.
아래 의 명령어로 contexts가 잘등록 된지 확인할수 있다.
전체 context 목록 확인
kubectl config get-contexts
현제 context 목록 확인
kubectl config current-context
context 바꾸기
kubectl config use-context minikube
kubectl get svc
kubectl get nodes -o wide
kubectl get pods --all-namespaces -o wide