안내

  • 이 가이드는 Kubernetes v1.30 기준으로 작성되었습니다.

도구 설치

Windows의 경우 WSL2를 설치하여 Linux 환경에서 ale을 이용하는 것을 권장합니다. 여기를 참고하여 WSL2를 먼저 설치하세요.


Google Cloud 계정 설정

gcloud CLI 초기화

1

사용할 Google 계정과 Region 및 Zone을 등록하기 위해 다음의 명령어를 실행하세요.

gcloud init
2

프롬프트에 `Sign in with a new Google Account`에 해당되는 숫자값을 입력하여 Google 계정에 로그인합니다.이미 로그인 된 계정을 사용하는 경우 해당 숫자값을 입력하세요.

  Choose the account you want to use for this configuration.
  To use a federated user account, exit this command and sign in to the gcloud CLI with your login configuration file, then run this command again.

  Select an account:
    [1] Sign in with a new Google Account
    [2] Skip this step
  Please enter your numeric choice: 
3

Google Cloud는 프로젝트를 단위로 하여 리소스를 할당하고 사용합니다. `Create a new project`에 해당되는 숫자값을 입력하여 새로운 프로젝트를 생성하세요. 만약 기존에 생성된 프로젝트를 사용하는 경우 해당 숫자값을 입력합니다.

Pick cloud project to use:
 [1] Enter a project ID
 [2] Create a new project
Please enter numeric choice or text value (must exactly match list item):  
4

Region 및 Zone의 기본값을 지정하는지 묻는 프롬프트에 y를 입력하고 기본값으로 지정할 Region/Zone에 해당하는 숫자값을 입력합니다.

Do you want to configure a default Compute Region and Zone? (Y/n)?   y

Which Google Compute Engine zone would you like to use as project default?
If you do not specify a zone via a command line flag while working with Compute Engine resources, the default is assumed.
 [1] us-east1-b
 [2] us-east1-c
 [3] us-east1-d
 [4] us-east4-c
 [5] us-east4-b
 [6] us-east4-a
 [7] us-central1-c
 [8] us-central1-a
 [9] us-central1-f
 [10] us-central1-b
 [11] us-west1-b
 [12] us-west1-c
 [13] us-west1-a
...
Did not print [75] options.
Too many options [125]. Enter "list" at prompt to print choices fully.
Please enter numeric choice or text value (must exactly match list item):

다음과 같이 표시되면 정상 처리된 것입니다.

...
The Google Cloud CLI is configured and ready to use!

* Commands that require authentication will use ale@example.com by default
* Commands will reference project `ale` by default
* Compute Engine commands will use region `asia-northeast3` by default
* Compute Engine commands will use zone `asia-northeast3-a` by default
...

환경변수 등록

위에서 생성한 프로젝트 ID, Region, 클러스터 이름 및 노드가 위치할 Zone을 환경변수로 등록하세요.

export GCP_PROJECT_ID=<GCP 프로젝트 ID>
export GCP_REGION=<GCP 리전>
export NODE_LOCATIONS=<클러스터 노드가 위치할 zone> 
export CLUSTER_NAME=<생성할 GKE 클러스터명>

gcloud 계정 및 프로젝트 설정

1

다음의 명령어를 입력하여 Google 계정에 로그인합니다.

gcloud auth login

자동으로 브라우저가 실행된 후 Google 계정 로그인을 위한 페이지가 표시됩니다. 브라우저에서 로그인 작업을 마치면 터미널에서 로그인이 완료되었다는 메세지를 확인할 수 있습니다.

2

이어서 프로젝트를 설정하기 위해 다음의 명령어를 실행하세요.

gcloud config set project $GCP_PROJECT_ID