You need to register your GKE cluster with your project's fleet by using Connect. A fleet provides a unified way to view and manage multiple clusters and their workloads. You can find out more about fleets and the functionality that they enable in our Fleets guide.
You don't need to register all your clusters at once, but clusters won't appear on the Anthos Clusters page in the Cloud Console until you register them.
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.
Before you begin
Make sure you have the required permissions to register the cluster.
Registering your cluster
Ensure that the cluster has GKE Workload Identity enabled, following the instructions in our prerequisites.
Run either of the following commands to register the cluster:
gcloud container hub memberships register MEMBERSHIP_NAME \ --gke-uri=GKE_URI \ --enable-workload-identity
gcloud container hub memberships register MEMBERSHIP_NAME \ --gke-cluster=GKE_CLUSTER \ --enable-workload-identity
Replace the following:
- MEMBERSHIP_NAME: the membership name that you choose to uniquely represent the cluster being registered to the fleet.
- GKE_URI: the URI of the GKE cluster,
https://container.googleapis.com/v1/projects/my-gke-project/locations/us-central1-a/clusters/my-gke-cluster. You can obtain the URI by running
gcloud container clusters list --uri.
- GKE_CLUSTER: the
location/nameof the GKE cluster from the current project. The location can be a zone or a region, for example:
- Learn more about the gcloud container hub command group.