> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ale.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Prerequisites

> Prerequisites for installing ale on a GKE cluster.

<Info>
  **Note**

  * This guide is based on **Kubernetes v1.30**.
</Info>

***

## Install Tools

<Warning>
  For Windows, it is recommended to install WSL2 and use ale in a Linux environment.
  Refer to [this guide](https://learn.microsoft.com/en-us/windows/wsl/install) to install WSL2 first.
</Warning>

<AccordionGroup>
  <Accordion title="gcloud CLI">
    Run the following command to install the gcloud CLI and restart your shell.

    ```bash theme={null}
    curl https://sdk.cloud.google.com | bash
    exec -l $SHELL
    ```

    Install the `gke-gcloud-auth-plugin` by running the following command:

    ```bash theme={null}
    gcloud components install gke-gcloud-auth-plugin
    ```
  </Accordion>

  <Accordion title="kubectl">
    Install kubectl according to your OS and architecture.

    **macOS**

    <CodeGroup>
      ```bash macOS(Apple Silicon) theme={null}
      curl -LO "https://dl.k8s.io/release/v1.30.2/bin/darwin/arm64/kubectl"
      ```

      ```bash macOS(Intel) theme={null}
      curl -LO "https://dl.k8s.io/release/v1.30.2/bin/darwin/amd64/kubectl"
      ```
    </CodeGroup>

    **Linux**

    <CodeGroup>
      ```bash Linux(x86-64) theme={null}
      curl -LO https://dl.k8s.io/release/v1.30.2/bin/linux/amd64/kubectl
      ```

      ```bash Linux(arm64) theme={null}
      curl -LO https://dl.k8s.io/release/v1.30.2/bin/linux/arm64/kubectl
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="helm">
    ```bash theme={null}
    curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
    chmod 700 get_helm.sh
    ./get_helm.sh  
    ```
  </Accordion>
</AccordionGroup>

***

## Set Up Google Cloud Account

### Initialize gcloud CLI

<Steps>
  <Step title="Run the following command to register the Google account, region, and zone.">
    ```bash theme={null}
    gcloud init
    ```
  </Step>

  <Step title="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.">
    ```bash theme={null}
      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: 
    ```
  </Step>

  <Step title="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.">
    ```bash theme={null}
    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):  
    ```
  </Step>

  <Step title="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.">
    ```bash theme={null}
    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):
    ```

    <Info>
      If you see the following message, the setup is complete.

      ```bash theme={null}
      ...
      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
      ...
      ```
    </Info>
  </Step>
</Steps>

### Environment Variables

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

```bash theme={null}
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

<Steps>
  <Step title="Run the following command to log in to your Google account.">
    ```bash theme={null}
    gcloud auth login
    ```

    <Info>
      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.
    </Info>
  </Step>

  <Step title="Next, set the project by running the following command.">
    ```bash theme={null}
    gcloud config set project $GCP_PROJECT_ID
    ```
  </Step>
</Steps>
