This page shows you how to set up Anthos on Google Cloud only.
Before you start
Sign in to your Google Account.
If you don't already have one, sign up for a new account.
In the Cloud Console, on the project selector page, select or create a Cloud project.
Make sure that billing is enabled for your Google Cloud project. Learn how to confirm billing is enabled for your project.
- Enable the Anthos API.
- Install and initialize the Cloud SDK.
Anthos on Google Cloud supports both release channels and static versions. However, we recommend the use of release channels whenever possible, as they provide additional benefits such as automated updates to GKE clusters.
Registering clusters to the environ
Regardless of where your clusters are, you need to register any clusters that you want to use with Anthos with your project's environ by using Connect. An environ provides a unified way to view and manage multiple clusters and their workloads as part of Anthos. You can find out more about environs and the functionality that they enable in our Environs guide.
You don't need to register all your clusters at once, but you need to do so each time that you create a new cluster to make sure that it's visible on your Anthos Clusters page in the Cloud Console, and so that you can use all Anthos features. Anthos charges apply only to your registered clusters.
gcloud command-line tool provides you with some more advanced
cluster registration options that are not available in the
Cloud Console, including downloading and applying the Connect Agent
manifest yourself. To find out more about these options, see advanced registration options in the Connect documentation.
Check the Connect prerequisites before registering your cluster to ensure that you have the relevant permissions and enabled APIs to register a cluster.
To register a cluster:
In the Google Cloud Console, go to the Anthos Clusters page. This page shows all your registered clusters.
Click Register existing cluster.
Click Register next to the unregistered cluster that you want to add to your environ.
Specify the service account that you want to use when registering the cluster. We recommend keeping the default behavior and creating a new service account.
- If you select Create a new service account:
- Specify a Service account ID to identify your new service account.
- Choose if you want to download its service account key as a JSON file. We recommend keeping the default behavior and downloading the key because you won't be able to download it later.
- If you select Use existing service account, paste in the account's service account key in JSON format.
- If you select Create a new service account:
Optional: Specify a new membership name for your cluster. By default, a cluster's membership name is its current name. However, if your cluster's name is not unique within your project, you must specify a new unique membership name because all clusters require a unique identifier within their environ.
To register your cluster, click Submit.
Run either of the following commands:
gcloud container hub memberships register MEMBERSHIP_NAME \ --project=PROJECT_ID \ --gke-uri=GKE_URI \ --service-account-key-file=SERVICE_ACCOUNT_KEY_PATH
gcloud container hub memberships register MEMBERSHIP_NAME \ --project=PROJECT_ID \ --gke-cluster=GKE_CLUSTER \ --service-account-key-file=SERVICE_ACCOUNT_KEY_PATH
Replace the following:
- PROJECT_ID: your Google Cloud project ID of the GKE cluster being registered. Learn how to find this value.
- MEMBERSHIP_NAME: the membership name that you choose to uniquely represent the cluster being registered on the Hub.
- SERVICE_ACCOUNT_KEY_PATH: the local filepath to the
service account's private key JSON file downloaded as part of Prerequisites.
This service account key is stored as a secret named
- GKE_URI: the URI of the GKE cluster,
https://container.googleapis.com/projects/my-project/locations/us-central1-a/clusters/my-cluster. You can obtain the URI by running
gcloud container clusters list --uri.
- GKE_CLUSTER: the
location/nameof the GKE cluster. The location can be a zone or a region, for example:
Enabling Anthos features
After you set up your project and your GKE clusters, use the following guides to enable additional Anthos features for your applications. For complete documentation sets for all Anthos components, including tutorials, reference material, and more, see Anthos components.
Enabling features on Google Cloud
- Anthos Service Mesh:
- Anthos Config Management:
- Ingress for Anthos:
- Set up Cloud Run for Anthos
- Set up Binary Authorization