This is a Preview version of the Cloud Run for Anthos documentation for use with Anthos fleets and Anthos Service Mesh. Learn more.

The current GA version of the Cloud Run for Anthos documentation remains available for existing users. New product evaluations during the free trial should use the Preview installation documentation.

Installing Cloud Run for Anthos

Learn how to install the default components of Cloud Run for Anthos on Anthos clusters. Installing Cloud Run for Anthos installs Knative Serving into your cluster to connect and manage your stateless workloads. To learn more, see the Architectural overview of Cloud Run for Anthos.

During the Preview, Cloud Run for Anthos is available as an Anthos fleet component and uses Anthos Service Mesh. Installing Cloud Run for Anthos using an Anthos fleet enables you to manage and upgrade your installation independently of the other components in your fleet.

Before you begin

  • You must ensure that you have adequate permissions in your Google Cloud project to meet the requirements for your Anthos cluster, Anthos fleet, and Anthos Service Mesh:

    • If you have the Owner roles for the Google Cloud project, then you have more than the necessary permissions to create clusters, install, and then configure Cloud Run for Anthos.

    • The Anthos Service Mesh permissions requirements also meet all the permission requirements for installing and configuring Cloud Run for Anthos.

    • If your Anthos cluster runs outside of Google Cloud, there might be other required permissions. See the documentation and requirements for your cluster.

    • Using other roles and the minimum requirements:

      Depending on your organization, you can also meet the permission requirements through combination of the following predefined roles:

  • An Anthos cluster with the following configuration is required:

  • The command-line environment must be set up.

Installing Cloud Run for Anthos

The following steps install the default Cloud Run for Anthos components on Anthos clusters:

To install the default components of Cloud Run for Anthos:

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

    gcloud alpha container hub cloudrun enable --project=PROJECT_ID
    

    Replace PROJECT_ID with the ID of your Cloud project.

    For details and additional options, see the gcloud alpha container hub 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 ENABLED:

    gcloud alpha container hub features list  --project=PROJECT_ID
    

    Replace PROJECT_ID with the ID of your Cloud project.

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

    Result:

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

    Anthos on Google Cloud

    gcloud alpha container hub 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 alpha container hub cloudrun apply reference.

    Anthos on-prem

    gcloud alpha container hub cloudrun apply --kubeconfig=KUBECONFIG --context=CONTEXT
    

    Replace the following:

    • KUBECONFIG with the absolute path to your kubectl config file.
    • CONTEXT with the name of the context in your kubectl config file to use for connecting.

    For details and additional options, see the gcloud alpha container hub 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

  5. What's next

    Set up your installation of Cloud Run for Anthos.