This documentation is for the Latest version of Cloud Run for Anthos, which uses Anthos fleets and Anthos Service Mesh. Learn more.

The past version has been archived but the documentation remains available for existing users.

Setting up the command-line environment

Configure the command-line tools to connect to and interact with Cloud Run for Anthos.

These steps assume you are using a Mac or Linux operating system. If you are using Microsoft Windows, you need to adjust the commands.

Although you can choose to use the Cloud Console to manage Cloud Run for Anthos, there are some tasks that require the command-line tools.

To install and configure the command-line tools for Cloud Run for Anthos:

  1. Install and initialize the Cloud SDK.

  2. Configure the gcloud command-line tool defaults:

    1. Set your default Google Cloud project:

      gcloud config set project PROJECT_ID
      

      Replace PROJECT_ID with the ID of your Cloud project.

    2. Set the target platform:

      gcloud config set run/platform gke
      
    3. Set the location of your cluster:

      gcloud config set run/cluster_location ZONE_REGION
      

      Replace ZONE_REGION with the zone or region of your cluster.

    4. If you created and use a new namespace other than the default namespace, you can set that namespace as the default in gcloud command-line tool so that it's used each time you run a command:

      gcloud config set run/namespace NAMESPACE
      

      Replace NAMESPACE with the name of the namespace that you want the gcloud tool tool to use by default.

  3. Install the kubectl command-line tool:

    gcloud components install kubectl
    
  4. Optional: Ensure that all previously installed components are up-to-date:

    gcloud components update