gcloud managed-kafka clusters update

NAME
gcloud managed-kafka clusters update - update a Managed Service for Apache Kafka cluster
SYNOPSIS
gcloud managed-kafka clusters update(CLUSTER :--location=LOCATION)(--auto-rebalance--cpu=CPU--labels=[KEY=VALUE,…]--memory=MEMORY--ssl-principal-mapping-rules=SSL_PRINCIPAL_MAPPING_RULES--subnets=[SUBNETS,…]--clear-mtls-ca-pools    |--mtls-ca-pools=[MTLS_CA_POOLS,…])[--allow-broker-downscale-on-cluster-upscale][--async][GCLOUD_WIDE_FLAG]
DESCRIPTION
Update a Managed Service for Apache Kafka cluster.
EXAMPLES
To update an attribute in a cluster named mycluster located in us-central1, suchas the CPU, run the following:
gcloudmanaged-kafkaclustersupdatemycluster--location=us-central1--cpu=3
POSITIONAL ARGUMENTS
Cluster resource - Identifies the cluster to be updated. The arguments in thisgroup can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments 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
ID of the location of the Managed Service for Apache Kafka resource. Seehttps://cloud.google.com/managed-service-for-apache-kafka/docs/locationsfor a list of supported locations.To set thelocation attribute:
  • provide the argumentcluster on the command line with a fullyspecified name;
  • provide the argument--location on the command line.
REQUIRED FLAGS
At least one of these must be specified:
--auto-rebalance
Whether the automatic rebalancing is enabled. If automatic rebalancing isenabled, topic partitions are rebalanced among brokers when the number of CPUsin the cluster changes. Automatic rebalancing is enabled by default. Use--no-auto-rebalance to disable this flag.
--cpu=CPU
The number of vCPUs to provision for the cluster. The minimum is 3.
--labels=[KEY=VALUE,…]
List of label KEY=VALUE pairs to add. Keys must start with a lowercase characterand contain only hyphens (-), underscores (_),lowercase characters, and numbers. Values must contain only hyphens(-), underscores (_), lowercase characters, andnumbers.
--memory=MEMORY
The memory to provision for the cluster in bytes. The value must be between 1GiB and 8 GiB per vCPU. Ex. 1024Mi, 4Gi.
--ssl-principal-mapping-rules=SSL_PRINCIPAL_MAPPING_RULES
The rules for mapping mTLS certificate Distinguished Names (DNs) to shortenedprincipal names for Kafka ACLs. This flag corresponds exactly to thessl.principal.mapping.rules broker config and matches the formatand syntax defined in the Apache Kafka documentation. Setting or modifying thisfield will trigger a rolling restart of the Kafka brokers to apply the change.An empty string means that the default Kafka behavior is used. Example:"RULE:^CN=(.?),OU=ServiceUsers.$/$1@example.com/,DEFAULT"
--subnets=[SUBNETS,…]
A comma-separated list of VPC subnets from which the cluster is accessible. Bothbroker and bootstrap server IP addresses and DNS entries are automaticallycreated in each subnet. Only one subnet per network is allowed, and the subnetmust be located in the same region as the cluster. The project may differ. Aminimum of 1 subnet is required. A maximum of 10 subnets can be specified. Usecommas to separate multiple subnets. The name of the subnet must be in theformatprojects/PROJECT_ID/regions/REGION/subnetworks/SUBNET.
At most one of these can be specified:
--clear-mtls-ca-pools
Remove all the CA pools from the cluster. This will remove all root certificatesfrom the truststore of each broker in the cluster.
--mtls-ca-pools=[MTLS_CA_POOLS,…]
A comma-separated list of CA pools from the Google Cloud Certificate AuthorityService. The root certificates of these CA pools will be installed in thetruststore of each broker in the cluster for use with mTLS. A maximum of 10 CApools can be specified. CA pools can be in a different project and region thanthe cluster. This command overwrites the entire set of pools currentlyconfigured on the cluster. If you want to add a new pool to an existingconfiguration, you must provide the full list of both the old and new CA poolsin the command. Each CA pool must be in the formatprojects/PROJECT_ID/locations/LOCATION/caPools/CA_POOL.Clear the CA pools using the--clear-mtls-ca-pools flag.
OPTIONAL FLAGS
--allow-broker-downscale-on-cluster-upscale
If enabled, this setting allows an update operation that could significantlydecrease the per-broker vCPU and/or memory allocation, which can lead to reducedperformance and availability. By default, an update operation will fail if itresults in a reduction of 10% or more to the brokers' vCPU or memory allocation.
--async
Return immediately, without waiting for the operation in progress to complete.
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.

API REFERENCE
This command uses themanagedkafka/v1 API. The full documentationfor this API can be found at:https://cloud.google.com/managed-service-for-apache-kafka/docs
NOTES
These variants are also available:
gcloudalphamanaged-kafkaclustersupdate
gcloudbetamanaged-kafkaclustersupdate

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-08-13 UTC.