Note

  • This guide is based on Kubernetes v1.30.

Install Tools

For Windows, it is recommended to install WSL2 and use ale in a Linux environment. Refer to this guide to install WSL2 first.


Set Up Google Cloud Account

Initialize gcloud CLI

1

Run the following command to register the Google account, region, and zone.

gcloud init
2

At the prompt, enter the number corresponding to `Sign in with a new Google Account` to log in to your Google account. If you are already logged in, enter the number corresponding to the account you want to use.

  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 allocates and uses resources on a per-project basis. Enter the number corresponding to `Create a new project` to create a new project. If you want to use an existing project, enter the number corresponding to that 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

At the prompt asking if you want to configure a default Compute Region and Zone, enter `y` and then enter the number corresponding to the region/zone you want to set as default.

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):

If you see the following message, the setup is complete.

...
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
...

Environment Variables

Set the project ID, region, cluster name, and zone where the nodes will be located as environment variables.

export GCP_PROJECT_ID=<GCP Project ID>
export GCP_REGION=<GCP Region>
export NODE_LOCATIONS=<Zone for cluster nodes> 
export CLUSTER_NAME=<GKE Cluster Name>

gcloud Account and Project

1

Run the following command to log in to your Google account.

gcloud auth login

A browser will automatically open, displaying the Google account login page.
Once you complete the login process in the browser, you will see a confirmation message in the terminal.

2

Next, set the project by running the following command.

gcloud config set project $GCP_PROJECT_ID