Setting up Cloud Run for Anthos deployed on VMware

This guide shows how to set up a GKE On-Prem cluster with Cloud Run for Anthos deployed on VMware enabled.

Note that installing Cloud Run for Anthos deployed on VMware installs Knative Serving into the cluster to connect and manage your stateless workloads.

Prerequisites

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. In the Cloud Console, on the project selector page, select or create a Cloud project.

    Go to the project selector page

  3. Make sure that billing is enabled for your Google Cloud project. Learn how to confirm billing is enabled for your project.

Setting up gcloud

To set up the gcloud command line for Cloud Run for Anthos deployed on VMware:

  1. If you haven't already, install and initialize the Cloud SDK.

  2. Set the platform to kubernetes and set your default project setting for gcloud to the one you just created:

    gcloud config set run/platform kubernetes
    gcloud config set project PROJECT-ID

    Replace PROJECT_ID with your project ID.

  3. Update installed gcloud components:

    gcloud components update
  4. Install the gcloudcomponents:

    gcloud components install beta

Setting up kubectl

If you are already using GKE On-Prem, kubectl may already be installed.

If kubectl is not installed, you can install it using the command:

gcloud components install kubectl

Installing Cloud Run for Anthos deployed on VMware

You can install Cloud Run on an existing GKE On-Prem cluster or while creating or upgrading your cluster:

Anthos 1.2

When creating or upgrading a cluster, you can enable Cloud Run for Anthos deployed on VMware on a GKE On-Prem cluster by setting the cloudrun configuration in the config.yaml file:

cloudrun:
  enabled: true

To install on an existing cluster:

  1. Create a GKE On-Prem admin and user cluster by following the GKE On-Prem Installation guide.

  2. If you want to avoid specifying the --kubeconfig flag when using the gcloud or kubectl command line, set the KUBECONFIG environment variable:

    export KUBECONFIG=/path/to/kubeconfig

    Replace /path/to/kubeconfig with the path to your cluster's kubeconfig files.

  3. Install Cloud Run for Anthos deployed on VMware on the cluster:

    kubectl apply -f https://storage.googleapis.com/cloud-run-for-anthos/install/0.10.0/1-cluster-local-gateway.yaml
    kubectl apply -f https://storage.googleapis.com/cloud-run-for-anthos/install/0.10.0/2-cloudrun-operator.yaml
    kubectl apply -f https://storage.googleapis.com/cloud-run-for-anthos/install/0.10.0/3-knative-serving.yaml
    

Anthos 1.1

  1. Create a GKE On-Prem admin and user cluster by following the GKE On-Prem Installation guide.

  2. If you're running a version 1.0 GKE On-Prem cluster, you need to update the Connect Agent deployed to that cluster.

  3. If you want to avoid specifying the --kubeconfig flag when using the gcloud or kubectl command line, set the KUBECONFIG environment variable:

    export KUBECONFIG=/path/to/kubeconfig

    Replace /path/to/kubeconfig with the path to your cluster's kubeconfig files.

  4. Install Cloud Run for Anthos deployed on VMware to the cluster:

    kubectl apply -f https://storage.googleapis.com/cloud-run-for-anthos/install/0.10.0/1-cluster-local-gateway.yaml
    kubectl apply -f https://storage.googleapis.com/cloud-run-for-anthos/install/0.10.0/2-cloudrun-operator.yaml
    kubectl apply -f https://storage.googleapis.com/cloud-run-for-anthos/install/0.10.0/3-knative-serving.yaml
    

Setting up the Cloud Console

When using the Cloud Console, login to the cluster. If you are using a Kubernetes Service Account, be sure to add the cluster-admin role to the Service Account.

What's next