Step 1: Create a cluster Stay organized with collections Save and categorize content based on your preferences.
Before you begin:
These steps assume you have created environment variables in the previous steps. Check them with the following commands:
echo $PROJECT_IDecho $ANALYTICS_REGIONecho $ORG_NAMEecho $ENV_NAME
Click for descriptions and commands to define the variables.
These steps use the following environment variables:
- PROJECT_ID: The ID of your Google Cloud project. SeeHybrid quickstart - Step 2: Create a Google Cloud project
export PROJECT_ID=your_project_ID
- ANALYTICS_REGION: The region in which your GKE project is running.The analytics region for your org. SeeHybrid quickstart - Step 4: Create an organization
export ANALYTICS_REGION=your_analytics region
- ORG_NAME: The name of your org. This must match your Google Cloud project ID. SeeHybrid quickstart - Step 4: Create an organization
export ORG_NAME=your_organization_name
- ENV_NAME: The name of your hybrid environment. SeeHybrid quickstart - Step 6: Create an environment group
export ENV_NAME=your_environment_name
This step explains how to set up your shell environment and create a GKE cluster in your Google Cloud project.
Set up your terminal shell
Thegcloud tool provides the primary command-line interface for Google Cloud, andkubectl provides the primary command-line interface for running commands against Kubernetes clusters.
Be sure you have
gcloudandkubectlinstalled in your local shell. Thegcloudtool provides the primary command-line interface for Google Cloud, andkubectlprovides the primary command-line interface for running commands against Kubernetes clusters.gcloud -hkubectl -h- If you do not have these utilities installed, install them now as follows:
- Install the Cloud SDK, which includes the
gcloudcommand-line tool. - After installing Cloud SDK, install the
kubectlcommand-line tool by running the following command:
gcloud components install kubectl
- Install the Cloud SDK, which includes the
- Use the
gcloudtool to configure two default settings: your defaultproject andcompute region. Configuring these settings makes it easier to rungcloudcommands, becausegcloudrequires that you specify the project and compute region in which you want to work.To list the current settings, run the following command:
gcloud config list
If a project and/or compute region 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, you can also use these commands:
gcloud config set project$PROJECT_ID
gcloud config set compute/region$ANALYTICS_REGIONWhere:
- PROJECT_ID is the name of your Google Cloud project.
- ANALYTICS_REGION is the name of a Google Cloud compute region
Create a GKE cluster
Caution:Apigee does not supportGKE Sandbox orgVisor. In this step, you will create a Kubernetes cluster in your Google Cloud project (the project you set with thegcloud config command represented byPROJECT_ID).
gcloud configurationfor the compute region, as explained in the previous steps. If you did not set the configuration, then you will needto add the--region "compute-region" parameter to the command.Note:We recommend you check the default Kubernetes version and make sure it meets the version requirements listed inSupported platforms. To determine which Kubernetes version is the default, use the following 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, seegcloud container clusters create.
Create the cluster
- Create the CLUSTER_NAME environment variable with the following command (optional):
export CLUSTER_NAME=cluster-name
Wherecluster-name is the name you choose for the cluster.
- 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:The size of the cluster you will create in this step has a minimal amount of resources suitable for trial or testing only. For more detailed information, about cluster resource requirements for production and non-production environments, see:
gcloud container clusters create$CLUSTER_NAME \--machine-type "e2-standard-4" --num-nodes "4" --enable-autoscaling --min-nodes "3" --max-nodes "6"
Cluster creation can take a few minutes. Upon success, output similar to the following, with a status of
RUNNING, is displayed:NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUSapigee-hybrid us-central1 1.15.12-gke.2 35.222.54.89 e2-standard-4 1.15.12-gke.2 RUNNING
Set the current context
Acontext 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 forkubectl: allkubectl commands run against that cluster.
Make sure the currentgcloud context is set to the cluster you just created.
- First, list the contexts to determine which is thecurrent context. In the following example, the current context is
gke_hybrid-project_us-central1_apigee-hybrid. The name includes the name of a Google Cloud project (hybrid-project), a region (us-central1), and a cluster name (apigee-hybrid).kubectl config get-contexts
The results should look something like the following example:
CURRENT NAME CLUSTER AUTHINFO NAMESPACE* gke_hybrid-project_us-central1_apigee-hybrid gke_hybrid-project_us-central1_apigee-hybrid gke_hybrid-project_us-central1_apigee-hybrid gke_apigee-project_us-west1_apigee-cluster gke_apigee-project_us-west1_apigee-cluster gke_apigee-project_us-west1_apigee-cluster
- If necessary, set the current context to the cluster you just created (the cluster into which you intend to install Apigee hybrid). Using the previous
get-contextsoutput, you can switch to the correct context, as follows:kubectl config use-contextcontext
Wherecontext is the full context name for your cluster as output by the previous
get-contextscommand. For example:gke_apigee-project_us-west1_apigee-cluster. - Check the current context to be sure it is set to the intended cluster using the following command:
kubectl config current-context
For example:
gke_apigee-project_us-west1_apigee-cluster
Grant cluster credentials
Cluster credentials give you access to the containers running in the cluster. Fetch your credentials and grant yourself thecluster-admin role:
- Fetch the credentials by entering the following command:
gcloud container clusters get-credentials$CLUSTER_NAME
Where
CLUSTER_NAMEis the name is the name of the cluster you created (the cluster into which you intend to install Apigee hybrid).You should see a result similar to the following:
Fetching cluster endpoint and auth data.kubeconfig entry generated for example-cluster.
- Set the cluster role binding. Execute the following command exactly as shown:
kubectl create clusterrolebinding cluster-admin-binding \--clusterrole cluster-admin --user $(gcloud config get-value account)
You should see a result similar to the following:
clusterrolebinding.rbac.authorization.k8s.io/cluster-admin-binding created
Summary
You now have a Kubernetes cluster running in your Google Cloud project. Your shell environment is set up, and you are ready to install the cert-manager and istio services required by Apigee hybrid on your local machine.
1(NEXT) Step 2: Install cert-manager and ASM345Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.