gcloud alpha container attached clusters register

NAME
gcloud alpha container attached clusters register - register an Attached cluster
SYNOPSIS
gcloud alpha 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]
DESCRIPTION
(ALPHA) Register an Attached cluster.
EXAMPLES
Register a cluster to a fleet.

To register a cluster with a private OIDC issuer, run:

gcloudalphacontainerattachedclustersregistermy-cluster--location=us-west1--platform-version=PLATFORM_VERSION--fleet-project=FLEET_PROJECT_NUM--distribution=DISTRIBUTION--context=CLUSTER_CONTEXT--has-private-issuer

To register a cluster with a public OIDC issuer, run:

gcloudalphacontainerattachedclustersregistermy-cluster--location=us-west1--platform-version=PLATFORM_VERSION--fleet-project=FLEET_PROJECT_NUM--distribution=DISTRIBUTION--context=CLUSTER_CONTEXT--issuer-url=https://ISSUER_URL

To specify a kubeconfig file, run:

gcloudalphacontainerattachedclustersregistermy-cluster--location=us-west1--platform-version=PLATFORM_VERSION--fleet-project=FLEET_PROJECT_NUM--distribution=DISTRIBUTION--context=CLUSTER_CONTEXT--has-private-issuer--kubeconfig=KUBECONFIG_PATH

To register and set cluster admin users, run:

gcloudalphacontainerattachedclustersregistermy-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,USER2

To specify custom tolerations and labels for system component pods, run:

gcloudalphacontainerattachedclustersregistermy-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=LABELS

where TOLERATIONS have the format:

key=value:Effect:NoSchedule(examples:key1=value1:Equal:NoSchedule,key2:Exists:PreferNoSchedule,:Exists:NoExecute)andLABELShavetheformat:key=value(examples:key1=value1,key2="")
POSITIONAL ARGUMENTS
Cluster resource - cluster to register. The arguments in this group can be usedto specify the attributes of this resource. (NOTE) Some attributes are not givenarguments in this group but can be set in other ways.

To set theproject attribute:

  • provide the argumentcluster on the command line with a fullyspecified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

This must be specified.

CLUSTER
ID of the cluster or fully qualified identifier for the cluster.

To set thecluster attribute:

  • provide the argumentcluster on the command line.

This positional argument must be specified if any of the other arguments in thisgroup are specified.

--location=LOCATION
Google Cloud location for the cluster.

To set thelocation attribute:

  • provide the argumentcluster on the command line with a fullyspecified name;
  • provide the argument--location on the command line;
  • set the propertycontainer_attached/location.
REQUIRED FLAGS
--distribution=DISTRIBUTION
Set the base platform type of the cluster to attach.

Examples:

gcloudalphacontainerattachedclustersregister--distribution=aksgcloudalphacontainerattachedclustersregister--distribution=eksgcloudalphacontainerattachedclustersregister--distribution=generic
--fleet-project=FLEET_PROJECT
ID or number of the Fleet host project where the cluster is registered.
--platform-version=PLATFORM_VERSION
Platform version to use for the cluster.

To retrieve a list of valid versions, run:

gcloudalphacontainerattachedget-server-config--location=LOCATION

ReplaceLOCATION with the target GoogleCloud location for the cluster.

kubectl config

This must be specified.

--context=CONTEXT
Context to use in the kubeconfig.

This flag argument must be specified if any of the other arguments in this groupare specified.

--kubeconfig=KUBECONFIG
Path to the kubeconfig file.

If not provided, the default at ~/.kube/config will be used.

OIDC config

Exactly one of these must be specified:

--has-private-issuer
Indicates no publicly routable OIDC discovery endpoint exists for the Kubernetesservice account token issuer.

If this flag is set, gcloud will read the issuer URL and JWKs from the cluster'sapi server.

--issuer-url=ISSUER_URL
Issuer url of the cluster to attach.
OPTIONAL FLAGS
--admin-groups=[GROUP,…]
Groups of users that can perform operations as a cluster administrator.
--admin-users=[USER,…]
Users that can perform operations as a cluster administrator.
--annotations=ANNOTATION,[ANNOTATION,…]
Annotations for the cluster.
--binauthz-evaluation-mode=BINAUTHZ_EVALUATION_MODE
Set Binary Authorization evaluation mode for this cluster.BINAUTHZ_EVALUATION_MODE must be one of:DISABLED,PROJECT_SINGLETON_POLICY_ENFORCE.
--description=DESCRIPTION
Description for the cluster.
--enable-managed-prometheus
Enables managed collection for Managed Service for Prometheus in the cluster.

Seehttps://cloud.google.com/stackdriver/docs/managed-prometheus/setup-managed#enable-mgdcoll-gkefor 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,…]
Set the components that have logging enabled.

Examples:

gcloudalphacontainerattachedclustersregister--logging=SYSTEMgcloudalphacontainerattachedclustersregister--logging=SYSTEM,WORKLOADgcloudalphacontainerattachedclustersregister--logging=NONE

COMPONENT must be one of:NONE,SYSTEM,WORKLOAD.

--system-component-labels=[LABEL,…]
Kubernetes labels to be applied to system component pods.
--system-component-tolerations=[TOLERATION,…]
Kubernetes tolerations to be applied to system component pods.
--tags=TAG,[TAG,…]
Tag keys/values directly bound to this resource.

The short name of a tag key or value can have a maximum length of 256characters. The permitted character set for the short name includes UTF-8encoded Unicode characters except single quotes, double quotes, backslashes, andforward slashes.

--validate-only
Validate the cluster to create, but don't actually perform it.
Cloud Monitoring Config

At most one of these can be specified:

--disable-cloud-monitoring
Disables managed collection for Cloud Monitoring in the cluster.

Cloud Monitoring is enabled by default for all clusters. Beginning with clusterversion 1.31, use --disable-cloud-monitoring to disable.

--enable-cloud-monitoring
Enables managed collection for Cloud Monitoring in the cluster.

Cloud Monitoring is enabled by default for all clusters. Beginning with clusterversion 1.31, use --disable-cloud-monitoring to disable.

Proxy config
--proxy-secret-name=PROXY_SECRET_NAME
Name of the Kubernetes secret that contains the HTTP/HTTPS proxy configuration.

This flag argument must be specified if any of the other arguments in this groupare specified.

--proxy-secret-namespace=PROXY_SECRET_NAMESPACE
Namespace of the Kubernetes secret that contains the HTTP/HTTPS proxyconfiguration.

This flag argument must be specified if any of the other arguments in this groupare specified.

GCLOUD WIDE FLAGS
These flags are available to all commands:--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.

NOTES
This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. This variant is also available:
gcloudcontainerattachedclustersregister

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-07 UTC.