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.

Installing Cloud Run for Anthos on Google Cloud

Learn how to install Cloud Run for Anthos in your Anthos clusters on Google Cloud. Cloud Run for Anthos now uses Anthos Service Mesh and Anthos fleets. Learn what's new and changed with Cloud Run for Anthos fleet installations.

Warning: Performing the steps on this page will perform a new installation of Cloud Run for Anthos and irreversibly overwrite your previous non-fleet installation. Do not proceed with the following steps in your clusters for which you previously enabled Cloud Run for Anthos.

For previous "free-trial" installations of Cloud Run for Anthos, you must first upgrade Cloud Run for Anthos to use Anthos fleets.

Use this page to install the default components of Cloud Run for Anthos on your Anthos clusters in Google Cloud with the following configuration:

  • Cloud Run for Anthos on Google Cloud is configured for public clusters by default.

  • Cloud Monitoring metrics for Anthos on Google Cloud clusters are enabled by default.

Before you begin

  • To install Cloud Run for Anthos in private clusters on Google Cloud, you must perform a custom installation.

  • You must ensure that you meet the installation prerequisites.

  • If Cloud Run for Anthos is installed in your cluster, you must ensure that the "GKE add-on" does not exist before you perform these fleet component installation steps. If you have the "add-on" installed, you must instead follow the steps for upgrading to Anthos fleets.

    Check if the "GKE add-on" is installed.

    To check if your installation of Cloud Run for Anthos is the "GKE add-on", run the following command:

    gcloud container clusters describe \
    CLUSTER_NAME \
    --region CLUSTER_LOCATION \
    --project PROJECT_ID --format='get(addonsConfig.cloudRunConfig)'
    

    Replace:

    • CLUSTER_NAME with the name of your cluster.
    • CLUSTER_LOCATION with the location where your cluster is located.
    • PROJECT_ID with the ID of your Google Cloud project.

    Results:

    • "GKE add-on" not installed:
      • Nothing is returned to your terminal if the add-on was never installed.
      • disabled=true is returned if the add-on was previously uninstalled.
    • "GKE add-on" is installed: If the add-on is installed in your cluster, the configuration details for the add-on are returned. Example: loadBalancerType=LOAD_BALANCER_TYPE_EXTERNAL
    Example:
    The following example demonstrates that Cloud Run for Anthos was installed in the my-addon-cluster cluster through the "GKE add-on", which is configured to handle external traffic:
    gcloud container clusters describe my-addon-cluster \
    --region us-central1-c --project my-gcp-project \
    --format='get(addonsConfig.cloudRunConfig)'
    

    Response:

    loadBalancerType=LOAD_BALANCER_TYPE_EXTERNAL
    

Installing Cloud Run for Anthos

To install the default components of Cloud Run for Anthos:

  1. Enable Cloud Run for Anthos in your Anthos fleet:

    gcloud container fleet cloudrun enable --project=PROJECT_ID
    

    Replace PROJECT_ID with the ID of your Google Cloud project.

    For details and additional options, see the gcloud container fleet cloudrun enable reference.

  2. Optional: Verify that the Cloud Run for Anthos feature component is enabled:

    Console

    View if the Cloud Run for Anthos component is Enabled in the Google Cloud console:

    Go to Anthos features

    features page

    Command line

    View if the appdevexperience state is ACTIVE:

    gcloud container fleet features list  --project=PROJECT_ID
    

    Replace PROJECT_ID with the ID of your Google Cloud project.

    For details and additional options, see the gcloud container fleet features list reference.

    Result:

    NAME               STATE
    appdevexperience   ACTIVE
    
  3. For each Anthos cluster where you want to install Cloud Run for Anthos, run the corresponding command:

    gcloud container fleet cloudrun apply --gke-cluster=CLUSTER_LOCATION/CLUSTER_NAME
    

    Replace the following:

    • CLUSTER_LOCATION with the region or zone in which your cluster is located.
    • CLUSTER_NAME with the ID of your cluster or the fully qualified identifier for the cluster.

    For details and additional options, see the gcloud container fleet cloudrun apply reference.

  4. Verify that Cloud Run for Anthos has been enabled in your cluster:
    1. Open the Google Cloud console: Go to Anthos clusters
    2. Click on the name of your cluster to open the details pane. Example:

      cluster details pane

    3. Run this command to check if you can see the Cloud Run for Anthos version details: kubectl get namespace knative-serving -o 'go-template={{index .metadata.labels "serving.knative.dev/release"}}'
    4. Verify that all Cloud Run for Anthos specific deployments are in running status under knative-serving and appdevexperience namespaces.

What's next

Set up your installation of Cloud Run for Anthos.