1 개요[ | ]
- kubectl GKE 클러스터 접근
2 사전작업[ | ]
- 윈도우 kubectl 설치[1]
- 윈도우 gcloud CLI 설치
- 윈도우 gke-gcloud-auth-plugin 설치 (gcloud components install gke-gcloud-auth-plugin)
3 본작업[ | ]
bat
Copy
gcloud container clusters get-credentials 클러스터명 --region=리전
또는
gcloud container clusters get-credentials 클러스터명
- → gcloud init할 때 지정한 디폴트 리전과 같다면, 리전을 생략해도 된다.
doscon
Copy
C:\Users\user>gcloud container clusters get-credentials cluster1
Fetching cluster endpoint and auth data.
kubeconfig entry generated for cluster1.
doscon
Copy
C:\Users\user>kubectl config view
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: DATA+OMITTED
server: https://34.56.78.90
name: gke_project1_asia-northeast3-b_cluster1
contexts:
- context:
cluster: gke_project1_asia-northeast3-b_cluster1
user: gke_project1_asia-northeast3-b_cluster1
name: gke_project1_asia-northeast3-b_cluster1
current-context: gke_project1_asia-northeast3-b_cluster1
kind: Config
preferences: {}
users:
- name: gke_project1_asia-northeast3-b_cluster1
user:
exec:
apiVersion: client.authentication.k8s.io/v1beta1
args: null
command: gke-gcloud-auth-plugin.exe
env: null
installHint: Install gke-gcloud-auth-plugin for use with kubectl by following
https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#install_plugin
interactiveMode: IfAvailable
provideClusterInfo: true
doscon
Copy
C:\Users\user>kubectl get no
NAME STATUS ROLES AGE VERSION
gke-cluster1-worker1-c2b5d85e-8wd5 Ready <none> 14h v1.27.11-gke.1062003
gke-cluster1-worker1-c2b5d85e-bcs8 Ready <none> 14h v1.27.11-gke.1062003
4 같이 보기[ | ]
5 참고[ | ]
- ↑ GKE 문서에는 kubectl을 gcloud components install kubectl로 설치하도록 안내되어 있지만, 다음 방법(예: winget install kubectl)로 설치해도 된다.
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.
- 분류 댓글:
- 윈도우 (9)
FastStone 이미지 뷰어 ― John Jeong윈도우 98 ― …윈도우 openssl 설치 ― …윈도우 TeX Live 설치 ―Pinkcrimson
윈도우 TeX Live 설치 ―Pinkcrimson
윈도우 TeX Live 설치 ―Pinkcrimson
윈도우 단축키 ― Kyeseung Kim윈도우 단축키 ― John Jeong윈도우에 SFTP 서버 구축하기 ― …