> [!CAUTION]
> You are currently viewing version 1.2 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions).

<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.2 (unsupported)</button>

- Supported versions:
- [v1.17 (latest)](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/install-create-cluster.md.txt)
- [v1.16](https://docs.cloud.google.com/apigee/docs/hybrid/v1.16/install-create-cluster.md.txt)
- [v1.15](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/install-create-cluster.md.txt)
- [v1.14](https://docs.cloud.google.com/apigee/docs/hybrid/v1.14/install-create-cluster.md.txt)
- [List of supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions)
- Unsupported versions:
- [v1.13](https://docs.cloud.google.com/apigee/docs/hybrid/v1.13/install-create-cluster.md.txt)
- [v1.12](https://docs.cloud.google.com/apigee/docs/hybrid/v1.12/install-create-cluster.md.txt)
- [v1.11](https://docs.cloud.google.com/apigee/docs/hybrid/v1.11/install-create-cluster.md.txt)
- [v1.10](https://docs.cloud.google.com/apigee/docs/hybrid/v1.10/install-create-cluster.md.txt)
- [v1.9](https://docs.cloud.google.com/apigee/docs/hybrid/v1.9/install-create-cluster.md.txt)
- [v1.8](https://docs.cloud.google.com/apigee/docs/hybrid/v1.8/install-create-cluster.md.txt)
- [v1.7](https://docs.cloud.google.com/apigee/docs/hybrid/v1.7/install-create-cluster.md.txt)
- [v1.6](https://docs.cloud.google.com/apigee/docs/hybrid/v1.6/install-create-cluster.md.txt)
- [v1.5](https://docs.cloud.google.com/apigee/docs/hybrid/v1.5/install-create-cluster.md.txt)
- [v1.4](https://docs.cloud.google.com/apigee/docs/hybrid/v1.4/install-create-cluster.html)
- [v1.3](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/install-create-cluster.md.txt)
- [v1.2](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/install-create-cluster.md.txt)
- [v1.1](https://docs.cloud.google.com/apigee/docs/hybrid/v1.1/install-create-cluster.md.txt)

> [!WARNING]
> **UPGRADING:** If you are upgrading from v1.1.x to v1.2.0, see [Upgrading Apigee hybrid](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/upgrade.md.txt) for instructions. If you are performing a new installation, continue with the configurations described below.


This step explains how to set up your shell environment and create a GKE cluster
in your Google Cloud Platform (GCP) project.

## Set up your terminal shell

The `gcloud` tool provides the primary command-line interface
for GCP, and `kubectl` provides the primary command-line interface for
running commands against Kubernetes clusters.

1. Be sure you have `gcloud` and `kubectl` installed in your
   local shell. The `gcloud` tool provides the primary command-line interface
   for GCP, and `kubectl` provides the primary command-line interface for
   running commands against Kubernetes clusters.

       gcloud -h
       kubectl -h

2. If you do not have these utilities installed, install them now:
   1. [Install the Cloud SDK](https://cloud.google.com/sdk/install), which includes the `gcloud` command-line tool.
   2. After installing Cloud SDK, install the `kubectl` command-line tool by running the following command:

   ```
   gcloud components install kubectl
   ```
3. Use the `gcloud` tool to configure two default settings: your default [project](https://cloud.google.com/resource-manager/docs/creating-managing-projects) and [compute region](https://cloud.google.com/compute/docs/regions-zones/#available). Configuring these settings makes it easier to run `gcloud` commands, because `gcloud` requires that you specify the project and compute zone in which you want to work.


   To list the current settings:

   ```
   gcloud config list
   ```


   If a project and/or compute zone is not listed, then you need to add them with the
   commands shown below. If, from the list output, you determine that you need to switch the current settings
   to reflect your project and compute region (or zone), you can also use these commands:

       gcloud config set project project-id
       gcloud config set compute/region compute-region
       gcloud config set compute/zone compute-zone


   Where <var translate="no">project-id</var> is the name of your GCP project, <var translate="no">compute-region</var> is
   the name of a GCP compute region, and <var translate="no">compute-zone</var> is
   the name of a GCP compute zone. For example: `compute/region us-central1`. For a list of
   compute regions and zones, see [Available regions and zones](https://cloud.google.com/compute/docs/regions-zones/#available).

## Create a GKE cluster

> [!WARNING]
> **Note:** Apigee does not support [GKE Sandbox](https://cloud.google.com/kubernetes-engine/docs/concepts/sandbox-pods) or [gVisor](https://github.com/google/gvisor).


In this step, you will create a Kubernetes cluster in your GCP project (the project you set
with the `gcloud config` command).

> [!NOTE]
> **NOTE:** The following command assumes you set the `gcloud` configuration for the compute region and/or zone, as explained in the previous steps. If you did not set the configuration, then you will need to add the `--region "compute-region"` and/or `--zone "compute-zone"` parameter to the command.


Execute the following command to create the cluster. The machine type, number of nodes, and
other settings specified in the command create a minimally configured cluster suitable for
a trial Apigee hybrid installation.

> [!NOTE]
>
> We recommend you check the default Kubernetes version and make sure it meets the version
> requirements listed in [Supported platforms](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/install-before-begin.md.txt#supported-platforms).
> To determine which Kubernetes version is the default, use this command:
>
> ```
> gcloud container get-server-config
> ```
>
>
> If you don't want to use the default, you can add the `--cluster-version` flag to the cluster
> creation command. For details, see [gcloud container clusters create.](https://cloud.google.com/sdk/gcloud/reference/container/clusters/create)

```
gcloud container clusters create cluster-name \
--machine-type "n1-standard-4" --num-nodes "3" --enable-autoscaling --min-nodes "3" --max-nodes "6"
```


Where <var translate="no">cluster-name</var> is the name you choose for the cluster.


Cluster creation can take a few minutes. Upon success, you will see output similar to
the following with a status of `RUNNING`:

```
NAME           LOCATION       MASTER_VERSION  MASTER_IP     MACHINE_TYPE   NODE_VERSION   NUM_NODES  STATUS
apigee-hybrid  us-central1-a  1.14.10-gke.27   35.222.54.89  n1-standard-4  1.14.10-gke.27          RUNNING
```

## Set the current context


A *context* is a group of access parameters. Each context contains a Kubernetes cluster,
a user and a namespace. The current context is the cluster that is currently the default for
`kubectl`: all `kubectl` commands run against that cluster.


Make sure the current `gcloud` context is set to the cluster you just created.

1. First, list the contexts to determine which is the *current* context. In the following example, the current context is `gke_hybrid-project_us-central1-a_apigee-hybrid`. The name includes the name of a GCP project (`hybrid-project`), a region or zone (`us-central1-a`), and a cluster name (`apigee-hybrid`):

   ```
   kubectl config get-contexts
   CURRENT   NAME                                             CLUSTER                                          AUTHINFO                                           NAMESPACE
   *         gke_hybrid-project_us-central1-a_apigee-hybrid   gke_hybrid-project_us-central1-a_apigee-hybrid   gke_hybrid-project_us-central1-a_apigee-hybrid
             gke_apigee-project_us-west1-a_apigee-cluster     gke_apigee-project_us-west1-a_apigee-cluster     gke_apigee-project_us-west1-a_apigee-cluster

   ```
2. If necessary, set the current context to the cluster you just created (the cluster into which you intend to install Apigee hybrid). Assuming the previous `get-contexts` output, if the cluster name you created were `apigee-cluster` in the region `us-west1`, you would switch to the `gke_apigee-project_us-west1-a_apigee-cluster` context, as follows:

   ```
   kubectl config use-context gke_apigee-project_us-west1-a_apigee-cluster
   ```

   Where `gke_apigee-project_us-west1-a_apigee-cluster` is the name of the context to switch to.
3. Check the current context to be sure it is set to the intended cluster. For example:

   ```
   kubectl config current-context
    gke_apigee-project_us-west1-a_apigee-cluster
   ```

## Grant cluster credentials


[Cluster credentials](https://cloud.google.com/sdk/gcloud/reference/container/clusters/get-credentials) give you access to the containers running in the cluster. Fetch your
credentials and grant yourself the **cluster-admin** role:

1. Fetch the credentials:

   ```
   gcloud container clusters get-credentials cluster-name
   ```

   Where <var translate="no">cluster-name</var> is the name is the name of the cluster you created (the
   cluster into which you intend to install Apigee hybrid).
2. Set the cluster role binding. Execute this command exactly as shown:

   ```
   kubectl create clusterrolebinding cluster-admin-binding \
   --clusterrole cluster-admin --user $(gcloud config get-value account)
   ```

## Summary


You now have a Kubernetes cluster running in your GCP project. Your shell environment is
set up, and you are ready to install the Apigee hybrid runtime plane software
on your local machine.
[1](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/install-create-cluster.md.txt) [(NEXT) Step 2: Install apigeectl](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/install-download-install.md.txt) [3](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/install-copy-overrides.md.txt) [4](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/install-apply-hybrid.md.txt)

<br />