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.

Deploying an application to Cloud Run for Anthos

Learn how to use the Google Cloud Console to deploy a prebuilt sample container to run as a Cloud Run for Anthos service.

Before you begin

You must have access to the Google Cloud project and Anthos cluster where Cloud Run for Anthos is installed. For details, see Installing Cloud Run for Anthos.

Tip: See the Anthos tutorial for details about the shortest path to setting up an Anthos environment that includes a GKE cluster and Anthos Service Mesh.

Deploying a sample container

Use the Google Cloud Console to deploy a sample container and create a service in your cluster:

  1. In the Cloud Console, go to the Cloud Run for Anthos page.

    Go to Cloud Run for Anthos

  2. Select the Google Cloud project in which your Anthos cluster resides.

  3. In the list of available clusters, click Login to connect.

  4. Open the Create service form by clicking Create service.

  5. In the available clusters dropdown menu, select your cluster.

  6. Leave default as the name of the namespace where you want your service to run.

  7. Enter a service name of your choice. For example, hello.

  8. Click Next.

  9. Select Deploy one revision from an existing container image, then select hello from in the Demo containers list.

  10. Click Next.

  11. Select External under Connectivity, so that you can access your service from the web.

  12. Click Create to deploy the hello image to Cloud Run for Anthos and wait for the deployment to finish.

Congratulations! You have just deployed a service to a Cloud Run for Anthos enabled cluster.

Accessing your deployed service

Now that you have a service running, you can to send requests to it. In this section, the default test domain is used to demonstrate how to access your service and verify that it's working:

  1. In the Cloud Console, go to the Cloud Run for Anthos page.

    Go to Cloud Run for Anthos

  2. Click the name of your new Cloud Run for Anthos service to open the Service details page. For example, hello.

  3. At the top of the page, click the URL to access your deployed service through your web browser. For example, if you named your service hello, the URL is similar to the following but includes your cluster's external IP address: http://hello.default.kuberun.11.111.11.111.nip.io

    hello url

Congratulations! Your Cloud Run for Anthos service is live and handling requests.

Clean up

You can delete the Cloud Run for Anthos service to avoid incurring costs from running those resources.

To permanently delete the service and all its resources:

  1. Go to Cloud Run for Anthos

  2. In the services list, locate the Cloud Run for Anthos service that you created and click its checkbox to select it.

  3. Click DELETE.

What's next

To learn how to build a container from code source, push to Container Registry, and then deploy, see:

To learn more about how Cloud Run for Anthos works, see the Architectural overview.