gcloud container attached clusters register (CLUSTER : --location=LOCATION) --distribution=DISTRIBUTION --fleet-project=FLEET_PROJECT --platform-version=PLATFORM_VERSION (--context=CONTEXT : --kubeconfig=KUBECONFIG) (--has-private-issuer | --issuer-url=ISSUER_URL) [--admin-groups=[GROUP,…]] [--admin-users=[USER,…]] [--annotations=ANNOTATION,[ANNOTATION,…]] [--binauthz-evaluation-mode=BINAUTHZ_EVALUATION_MODE] [--description=DESCRIPTION] [--enable-managed-prometheus] [--logging=COMPONENT,[COMPONENT,…]] [--system-component-labels=[LABEL,…]] [--system-component-tolerations=[TOLERATION,…]] [--tags=TAG,[TAG,…]] [--validate-only] [--disable-cloud-monitoring | --enable-cloud-monitoring] [--proxy-secret-name=PROXY_SECRET_NAME --proxy-secret-namespace=PROXY_SECRET_NAMESPACE] [GCLOUD_WIDE_FLAG …]
To register a cluster with a private OIDC issuer, run:
gcloud container attached clusters register my-cluster --location=us-west1 --platform-version=PLATFORM_VERSION --fleet-project=FLEET_PROJECT_NUM --distribution=DISTRIBUTION --context=CLUSTER_CONTEXT --has-private-issuerTo register a cluster with a public OIDC issuer, run:
gcloud container attached clusters register my-cluster --location=us-west1 --platform-version=PLATFORM_VERSION --fleet-project=FLEET_PROJECT_NUM --distribution=DISTRIBUTION --context=CLUSTER_CONTEXT --issuer-url=https://ISSUER_URLTo specify a kubeconfig file, run:
gcloud container attached clusters register my-cluster --location=us-west1 --platform-version=PLATFORM_VERSION --fleet-project=FLEET_PROJECT_NUM --distribution=DISTRIBUTION --context=CLUSTER_CONTEXT --has-private-issuer --kubeconfig=KUBECONFIG_PATHTo register and set cluster admin users, run:
gcloud container attached clusters register my-cluster --location=us-west1 --platform-version=PLATFORM_VERSION --fleet-project=FLEET_PROJECT_NUM --distribution=DISTRIBUTION --context=CLUSTER_CONTEXT --issuer-url=https://ISSUER_URL --admin-users=USER1,USER2To specify custom tolerations and labels for system component pods, run:
gcloud container attached clusters register my-cluster --location=us-west1 --platform-version=PLATFORM_VERSION --fleet-project=FLEET_PROJECT_NUM --distribution=DISTRIBUTION --context=CLUSTER_CONTEXT --system-component-tolerations=TOLERATIONS --system-component-labels=LABELSwhere TOLERATIONS have the format:
key=value:Effect:NoSchedule (examples: key1=value1:Equal:NoSchedule,key2:Exists:PreferNoSchedule, :Exists:NoExecute) and LABELS have the format:key=value (examples: key1=value1,key2="")
To set the project attribute:
cluster on the command line with a fully
specified name;
--project on the command line;
core/project.
CLUSTER
To set the cluster attribute:
cluster on the command line.
--location=LOCATIONlocation attribute:
cluster on the command line with a fully
specified name;
--location on the command line;
container_attached/location.
--distribution=DISTRIBUTIONExamples:
gcloud container attached clusters register --distribution=aksgcloud container attached clusters register --distribution=eksgcloud container attached clusters register --distribution=generic
--fleet-project=FLEET_PROJECT--platform-version=PLATFORM_VERSIONTo retrieve a list of valid versions, run:
gcloud alpha container attached get-server-config --location=LOCATIONLOCATION with the target Google
Cloud location for the cluster.
kubectl config
This must be specified.
--context=CONTEXT--kubeconfig=KUBECONFIG--has-private-issuer--issuer-url=ISSUER_URL--admin-groups=[GROUP,…]--admin-users=[USER,…]--annotations=ANNOTATION,[ANNOTATION,…]--binauthz-evaluation-mode=BINAUTHZ_EVALUATION_MODEBINAUTHZ_EVALUATION_MODE must be one of:
DISABLED, PROJECT_SINGLETON_POLICY_ENFORCE.
--description=DESCRIPTION--enable-managed-prometheusSee https://cloud.google.com/stackdriver/docs/managed-prometheus/setup-managed#enable-mgdcoll-gke for more info.
Managed Prometheus is enabled by default for cluster versions 1.27 or greater, use --no-enable-managed-prometheus to disable.--logging=COMPONENT,[COMPONENT,…]Examples:
gcloud container attached clusters register --logging=SYSTEMgcloud container attached clusters register --logging=SYSTEM,WORKLOADgcloud container attached clusters register --logging=NONE
COMPONENT must be one of: NONE,
SYSTEM, WORKLOAD.
--system-component-labels=[LABEL,…]--system-component-tolerations=[TOLERATION,…]--tags=TAG,[TAG,…]--validate-only--disable-cloud-monitoring--enable-cloud-monitoring--proxy-secret-name=PROXY_SECRET_NAME--proxy-secret-namespace=PROXY_SECRET_NAMESPACE--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha container attached clusters register
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.