Creating a fleet involves registering the clusters you want to manage together to a fleet in your chosen fleet host project. Depending on the cluster type and where it lives, registration can happen automatically at cluster creation time with registration details specified in the cluster configuration, or you may need to manually add the cluster to your fleet.
This page provides an overview of how fleet creation works, with details for different cluster types. For more information about how to manually register clusters to your fleet and prerequisites for manual registration, see our detailed fleet creation guides.
About fleet membership
Once you register a cluster to a fleet, it becomes a fleet member. Because fleets can include clusters from multiple projects and environments, you must ensure that each cluster you add to your fleet has a unique name. This is sometimes referred to in commands and documentation as the cluster's fleet membership name. Typically, a cluster's fleet membership name is its regular cluster name, but you may need to create a new name at registration time (for example by appending or prepending a qualifier to the original cluster name) if another cluster with that name already exists in the fleet. If you attempt to register a cluster with an existing name to your fleet, registration will fail.
GKE clusters on Google Cloud must be explicitly registered to add them to a fleet. You can choose between quick registration from the Fleets page in the Google Cloud console (users with the Anthos API enabled only), registration from the command line with the gcloud CLI, or declarative registration using Terraform or Config Connector. Find out more about these options in Register a GKE cluster to your fleet.
Clusters on Google Cloud can be registered to a fleet in their current project or (with some extra permissions) to a fleet in a different project.
Clusters outside Google Cloud
If you have enabled the Anthos platform, you can add clusters outside Google Cloud to your fleet and view and manage your clusters across different environments together. Anthos clusters (GKE clusters outside Google Cloud) are mostly registered to your fleet automatically at cluster creation time, as described in the rest of this section below. If you want to add third-party Kubernetes clusters to your fleet, you must register them manually.
Registering clusters outside Google Cloud installs the Connect Agent on the cluster to handle communication between the cluster and your Google Cloud project. You can read more about how the Connect Agent works in the Connect Agent overview.
Anthos clusters on-premises (Google Distributed Cloud Virtual)
Anthos clusters on VMware and Anthos clusters on bare metal are automatically registered to your chosen fleet at cluster creation time, with your fleet host project and other registration details specified in the relevant cluster configuration file. If you are using Anthos clusters on VMware, note that from version 1.13 onwards, both admin clusters and user clusters must be registered. For versions prior to 1.13, you can optionally add registration details to admin cluster configurations if you want to manage them as part of your fleet. You can register unregistered admin clusters by updating their cluster configuration file and using
gkectl to update the cluster. Anthos clusters on VMware cannot be unregistered or manually registered.
Anthos clusters on other public clouds
Anthos clusters on AWS and Azure created using the Anthos Multi-Cloud API are automatically registered to your chosen fleet at cluster creation time, with your fleet host project specified when you run the relevant
gcloud cluster create command. Because clusters created using Anthos Multi-Cloud already have a project associated with them (the project where the API is enabled), you need to do some additional setup at cluster creation if you want to register them to a fleet in a different project. Clusters created with the Anthos Multi-Cloud API cannot be unregistered or manually registered.
Third-party Kubernetes clusters (attached clusters)
If you have existing third-party Kubernetes clusters (such as EKS, AKS, or on-premises distributions) that you want to manage as fleet members, you can register these to your project fleet along with any GKE and Anthos clusters. You can attach any conformant Kubernetes cluster that includes x86 nodes to your fleet, although only certain cluster types and versions have been validated by Google. These include Amazon EKS, Azure AKS, and the current supported types and versions listed in Attach third-party Kubernetes clusters to your fleet. Any third-party clusters you register will incur a per-vCPU charge as part of your Anthos pricing.
To register an attached cluster, see the following guides:
- Attach your EKS cluster using the Anthos Multi-Cloud API.
- Attach your AKS cluster using the Anthos Multi-Cloud API.
- For all other cluster types, follow the instructions to attach third-party clusters, paying attention to any specific prerequisites for your Kubernetes cluster type.
Move a cluster to a different fleet
Moving registered clusters between fleets (unregistering then reregistering) is not currently recommended, as it can result in unexpected or unwanted behavior: for example, your workloads' fleet Workload Identity will change, potentially resulting in blocked requests and outages. The recommended approach is to create a new cluster in the fleet in which you want your workloads to reside, then move your workloads from your old cluster to the new cluster.
(Optional) Create an empty fleet
By default, a new fleet is created in your fleet host project the first time you register a cluster in that project. If you want to create a new named fleet before you register any clusters (for example, to set up scopes for team access), run the following command:
gcloud alpha container fleet create --display-name=NAME [--project=FLEET_HOST_PROJECT_ID]
If you don't specify a
display-name, the new fleet has a default display name based on its fleet host project name.
View your fleets
If your organization has multiple fleets, you can quickly view and navigate between them in the Google Cloud console by using the Fleet drop-down list at the top of the Anthos navigation menu. Selecting a fleet in this list automatically switches you to its fleet host project in the Google Cloud console.
Before you begin for all cluster types.
Register a GKE cluster: