Update clusters
After you create a cluster, you can change some aspects of the cluster'sconfiguration. For example you can:
- Add, remove, or replace nodes.
- Add or remove annotations to the cluster.
- Modify the values of mutable fields in the cluster and node pool resources.
- Modify other custom resources.
You can usebmctl or the Google Cloud CLI to make updates to a cluster. If youcreated an admin or user cluster using Terraform, then you can use Terraform toupdate the cluster. Note the following:
Many aspects of your cluster configuration are immutable and can't be updatedafter you create your cluster. For a comprehensive list of mutable andimmutable fields, see theCluster configuration field reference. The field reference is asortable table. Click the column headings to change the sort order. Click afield name to view its description.
The gcloud CLI and Terraform only support updating admin and userclusters. You have to use
bmctlto update other cluster types.The gcloud CLI and Terraform only support changes to thecluster and node pool resources. You have to use
kubectlorbmctltoupdate other custom resources that affect the cluster.Modifying the namespace of an existing cluster in the cluster configurationfile is
not a supported operationand can lead to clusterinstability and potential failures. To avoid these issues, don't attempt tomodify the cluster namespace after its creation.
This page is for Admins and architects and Operators who manage thelifecycle of the underlying tech infrastructure. To learn more about commonroles and example tasks that we reference in Google Cloud content, seeCommonGKE Enterprise user roles andtasks.
How to update clusters
Generally, you do the following sequence of actions to update a cluster:
bmctl
Change the values of the applicable fields in the cluster's configurationfile, which by default is located here:
bmctl-workspace/CLUSTER-NAME/CLUSTER-NAME.yamlUpdate the cluster by running the
bmctl updatecommand:bmctlupdatecluster-cCLUSTER_NAME--kubeconfig=KUBECONFIGReplace the following:
CLUSTER_NAME: the name of the cluster you want toupdate.KUBECONFIG: for admin, hybrid, or standaloneclusters, enter the path to the cluster's kubeconfig file. For a usercluster, enter the path to theadmin cluster's kubeconfig file.
bmctl update andkubectl apply -finterchangeably when editing the cluster configuration file. When thesecommands are used interchangeably, contents populated by the header of thecluster spec might be unintentionally removed. For example, you might usebmctl update to update the cluster configuration file toconfigure a registry mirror.The cluster then hasspec.nodeConfig.registryMirrors populatedafter reconciliation.If you then attempt to make changes to the cluster using the clusterconfiguration with thekubectl apply -f command, thespec.nodeConfig.registryMirrors populated by the reconcileron the cluster is removed. This behavior happens because the configurationdoesn't exist in the cluster configuration spec, but it does in the cluster.
gcloud CLI
Specify only the flags for the configuration that you want to modify.
Run the applicable update command:
Admin clusters:
gcloud container bare-metal admin-clusters updateUser clusters:
gcloud container bare-metal clusters update.Node pools on a user cluster:
gcloud container bare-metal node-pools update
Terraform
Change the values of the applicable fields in the Terraformconfiguration file that you used to create the cluster or node pool. Seethe Terraform reference documentation for detailed field descriptions:
Update the configuration by running the
terraform applycommand.
The following sections outline some common examples for updating an existingcluster.
Add or remove nodes in a cluster
Anode pool is a group ofnodes within a cluster that have the same configuration. Keep in mind that anode always belongs to a node pool. To add a new node to a cluster, you needto add it to a particular node pool. Removing a node from a node pool amountsto removing the node from the cluster altogether.
There are three kinds of node pools in Google Distributed Cloud: control plane, loadbalancer, and worker node pools. The following sections describe how toadd or remove nodes from each kind of node pool.
bmctl
You add or remove a node from a node pool by adding or removing the IP addressof the node in a specific section of the cluster configuration file. Thefollowing list shows which section to edit for a given node pool:
- Worker node pool: add or remove the IP address of the node in the
spec.nodessection of theNodePoolspec. - Control plane node pool: add or remove the IP address of the node in the
spec.controlPlane.nodePoolSpec.nodessection of theClusterspec. - Load balancer node pool: add or remove the IP address of the node in the
spec.loadBalancer.nodePoolSpec.nodessection of theClusterspec.
Example: remove a worker node
Here's a sample cluster configuration file that shows the specifications oftwo worker nodes:
---apiVersion:baremetal.cluster.gke.io/v1kind:NodePoolmetadata:name:nodepool1namespace:cluster-cluster1spec:clusterName:cluster1nodes:-address:192.0.2.1-address:192.0.2.2To remove a node:
(Optional) If the node that you're removing is running critical Pods,first put the node intomaintenance mode.
You can monitor the node draining process for worker nodes by viewing the
status.nodesDrainedandstatus.nodesDrainingfields on theNodePoolresource.Edit the cluster configuration file todelete the IP address entry for thenode.
Update the cluster:
bmctlupdatecluster1\--kubeconfig=ADMIN_KUBECONFIG
gcloud CLI
You use anupdate command to add or remove nodes. Theupdate command thatyou use and the flag in which you specify the IP address depends on the typeof node pool that you want to update:
Worker node pool: Run
gcloud container bare-metal node-pools updateandspecify the IP address in the flag--node-configs 'node-ip=IP_ADDRESS'.Control plane node pool on an admin cluster: Run
gcloud container bare-metal admin-clusters updateand specify the IPaddress in the flag--control-plane-node-configs 'node-ip=IP_ADDRESS'.Control plane node pool on a user cluster: Run
gcloud container bare-metal clusters updateand specify the IPaddress in the flag--control-plane-node-configs 'node-ip=IP_ADDRESS'.Load balancer node pool: Run
gcloud container bare-metal clusters updateand specify the IPaddress in the flag--metal-lb-load-balancer-node-configs 'node-ip=IP_ADDRESS'or--bgp-load-balancer-node-configs 'node-ip=IP_ADDRESS'
The flag in which you specify the IP address only accepts onenode-ip. Youinclude the flag for each IP address in the node pool.
Theupdate commands replace all IP addresses with the IP addresses thatyou specify. To add a node, include the IP addresses of the existingnodes and the IP address of the new node in theupdate command. Similarly,you remove nodes by only including the IP addresses of the nodes that youwant to keep.
Example: remove a worker node
This section shows how to remove a worker node from a node pool usingexample data. Additional gcloud CLI commands that you mightfind useful are also included in the following steps.
(Optional) If the node that you're removing is running critical Pods,first put the node intomaintenance mode.
You can monitor the node draining process for worker nodes by viewing the
status.nodesDrainedandstatus.nodesDrainingfields on theNodePoolresource.Run the
listcommand to list all the node pools in the cluster:gcloud container bare-metal node-pools list \ --cluster=abm-user-cluster1 \ --project=example-project-12345 \ --location=us-central1The output is similar to the following:
NAME LOCATION STATEnode-pool-1 us-central1 RUNNINGnode-pool-2 asia-east1 RUNNINGRun the
describecommand to list all the IP addresses in the node pool:gcloud container bare-metal node-pools describe node-pool-1 \ --cluster=abm-user-cluster1 \ --project=example-project-12345 \ --location=us-central1The following example output is truncated for readability:
annotations: ... baremetal.cluster.gke.io/version: 1.33...name: projects/example-project-12345/locations/us-central1/bareMetalClusters/abm-user-cluster1/bareMetalNodePools/node-pool-1nodePoolConfig: nodeConfigs: - nodeIp: 192.0.2.1 - nodeIp: 192.0.2.2 operatingSystem: LINUXstate: RUNNING...Note the following in the example output:
The
namefield contains the fully-qualified name of the node pool.When specifying the node pool name in a command, you can either specifythe fully-qualified name, or the node pool name, for example,node-pool-1, along with the--cluster,--project, and the--locationflags.The
nodeConfigssection contains twonodeIpfields with the IPaddresses of the nodes.
Run the following command to remove the node with the IP address192.0.2.1:
gcloud container bare-metal node-pools update node-pool-1 \ --cluster=abm-user-cluster1 \ --project=example-project-12345 \ --location=us-central1 \ --node-configs='node-ip=192.0.2.2'The
updatecommand replaces all IP addresses with the IP addresses thatyou specify. Because 192.0.2.1 isn't included, the node is removed.The output of the command is similar to the following:
Waiting for operation [projects/example-project-12345/locations/us-central1/operations/operation-1697154681749-6078d9def4030-76686d6e-9fcb1de9] to completeIn the example output, the string
operation-1697154681749-6078d9def4030-76686d6e-9fcb1de9is theOPERATION_IDof the long-running operation.You can find out the status of the operation by running the followingcommand in another terminal window:gcloud container bare-metal operations describe operation-1697154681749-6078d9def4030-76686d6e-9fcb1de9 \ --project= example-project-12345 \ --location=us-central1You can rerun the command every so often to check the status.
If the node removal fails, you can force its removal from the cluster.For details, seeReset a failed node in Google Distributed Cloud.
Replace HA control plane nodes
bmctl
You can usebmctl to replace high availability (HA) control plane nodes inall cluster types.
You replace a node in a cluster by performing the following steps:
- Remove the node's IP address from the cluster configuration file.
- Update the cluster.
- Check the status of nodes in the cluster.
- Add a new node's IP address to the same cluster configuration file.
- Update the cluster.
Example: replace a HA control plane node
Here's a sample cluster configuration file that shows three control planenodes in a user cluster:
---apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:user-clusternamespace:cluster-user-clusterspec:controlPlane:nodePoolSpec:nodes:-address:192.0.2.11-address:192.0.2.12-address:192.0.2.13To replace the last node listed in thespec.controlPlane.nodePoolSpec.nodessection, perform the following steps:
Remove the node by deleting its IP address entry in the clusterconfiguration file. After making this change, the cluster configuration fileshould look something like this:
---apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:user-clusternamespace:cluster-user-clusterspec:controlPlane:nodePoolSpec:nodes:-address:192.0.2.11-address:192.0.2.12Update the cluster by running the following command:
bmctl update cluster -cCLUSTER_NAME \ --kubeconfig=KUBECONFIG
Make the following changes:
- ReplaceCLUSTER_NAME with the name of the cluster you want toupdate.
- If the cluster is a self-managing cluster (such as admin or standalonecluster), replaceKUBECONFIG with the path to the cluster'skubeconfig file. If the cluster is a user cluster, as it is in thisexample, replaceKUBECONFIG with the path to theadmincluster's kubeconfig file.
After the
bmctl updatecommand has executed successfully, it takes sometime to complete themachine-preflightandmachine-initjobs. You canview the status of nodes and their respective node pools by running thecommands described in theVerify your updates sectionof this document. After the node pool and nodes are in a ready state, youcan proceed to the next step.Add a new control plane node to the node pool by adding the IP address ofthe new control plane node to the
spec.controlPlane.nodePoolSpec.nodessection of the cluster configuration file. After making this change, thecluster configuration file should look something like this:---apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:user-clusternamespace:cluster-user-clusterspec:controlPlane:nodePoolSpec:nodes:-address:192.0.2.11-address:192.0.2.12-address:192.0.2.14Update the cluster by running the following command:
bmctl update cluster -cCLUSTER_NAME \ --kubeconfig=KUBECONFIG
gcloud CLI
You can use the gcloud CLI to replace high availability (HA)control plane nodes in admin and user clusters.
You replace a node in a cluster by performing the following steps:
Remove the node's IP address by running the applicable
updatecommand:- User cluster:
gcloud container bare-metal clusters update - Admin cluster:
gcloud container bare-metal admin-clusters update
- User cluster:
Check the status of the node removal in the cluster by running
gcloud container bare-metal operations describeOPERATION_ID.Add the new node's IP address by running the applicable
updatecommand.
Example: replace a HA control plane node
This section shows how to replace a control plane from a cluster usingexample data. Additional gcloud CLI commands that you mightfind useful are also included in the following steps.
Run the
listcommand to list all the user clusters in aGoogle Cloud project:gcloud container bare-metal clusters list \ --project=example-project-12345 \ --location=-When you set
--location=-, that means to list all clusters in allregions. If you need to scope down the list, set--locationto aspecific region.The output is similar to the following:
NAME LOCATION VERSION ADMIN_CLUSTER STATEabm-user-cluster1a us-central1 1.33 abm-admin-cluster1 RUNNINGabm-user-cluster1b europe-west1 1.33 abm-admin-cluster1 RUNNINGRun the
describecommand on the cluster:gcloud container bare-metal clusters describe abm-user-cluster1 \ --project=example-project-12345 \ --location=us-central1The example output is truncated for readability:
...controlPlane: controlPlaneNodePoolConfig: nodePoolConfig: nodeConfigs: - nodeIp: 192.0.2.11 - nodeIp: 192.0.2.12 - nodeIp: 192.0.2.13 operatingSystem: LINUX...name: projects/example-project-1234567/locations/us-central1/bareMetalClusters/abm-user-cluster1a...Note the following in the example output:
The
namefield contains the fully-qualified name of the cluster.When specifying the cluster name in a command, you can either specifythe fully-qualified name, or the cluster name, for example,abm-user-cluster1a, along with the--projectand the--location flags.The
nodeConfigssection contains threenodeIpfields with the IPaddresses of the control plane nodes.
Remove the node with the IP address
192.0.2.13:gcloud container bare-metal cluster update abm-user-cluster1a \ --project=example-project-12345 \ --location=us-central1 \ --control-plane-node-configs 'node-ip=192.0.2.11' --control-plane-node-configs 'node-ip=192.0.2.12'The output of the command is similar to the following:
Waiting for operation [projects/example-project-12345/locations/us-central1/operations/operation-1956154681749-6078d9def4030-76686d6e-9fcb1d7] to completeIn the example output, the string
operation-1956154681749-6078d9def4030-76686d6e-9fcb1de7is theOPERATION_IDof the long-running operation.You can find out the status of the operation by running the followingcommand in another terminal window:gcloud container bare-metal operations describe operation-1956154681749-6078d9def4030-76686d6e-9fcb1de7 \ --project= example-project-12345 \ --location=us-central1You can rerun the command every so often to check the status.
Add the new node with the IP address
192.0.2.14:gcloud container bare-metal cluster update abm-user-cluster1a \ --project=example-project-12345 \ --location=us-central1 \ --control-plane-node-configs 'node-ip=192.0.2.11' --control-plane-node-configs 'node-ip=192.0.2.12' --control-plane-node-configs 'node-ip=192.0.2.14'
Verify your updates
kubectl
You can view the status of nodes and their respective node pools with thekubectl get command.
For example, the following command shows the status of the node pools in thecluster namespacecluster-my-cluster:
kubectl-ncluster-my-clustergetnodepools.baremetal.cluster.gke.ioThe system returns results similar to the following:
NAME READY RECONCILING STALLED UNDERMAINTENANCE UNKNOWNcluster-my-cluster 3 0 0 0 0cluster-my-cluster-lb 2 0 0 0 0np1 3 0 0 0 0Reconciling=1 means that the reconciliation step is still in progress. Youshould wait until the status changes toReconciling=0.
You can also check status of nodes in the a cluster by running followingcommand:
kubectlgetnodes--kubeconfig=KUBECONFIGgcloud CLI
As described previously, after running anupdate command, you cancheck the status of the operation usinggcloud container bare-metaloperations describeOPERATIONS_ID. The output ofthe command gives the status of the nodes, for example:
... metrics: - intValue: '1' metric: NODES_RECONCILING - intValue: '2' metric: NODES_HEALTHY - intValue: '0' metric: NODES_FAILED - intValue: '0' metric: NODES_IN_MAINTENANCE - intValue: '3' metric: NODES_TOTAL stage: HEALTH_CHECK...No matter which tool you use to update a node pool, you can get the currentstatus of a node pool by running the applicabledescribe command as shownpreviously.
If you need more information about how to diagnose your clusters, seeCreate snapshots for diagnosing clusters.
Load balancer address pools
bmctl
TheaddressPoolssection contains fields for specifying load-balancing pools for the MetalLBand Border Gateway Protocol (BGP) bundled load balancers. You can add moreload-balancing address pools at any time, but you can't remove any existingaddress pools. Starting with Google Distributed Cloud version 1.16.0, you canmodify the values foraddressPools.avoidBuggyIPs andaddressPools.manualAssign at any time.
addressPools:-name:pool1addresses:-198.51.100.0-198.51.100.4-198.51.100.240/28-name:pool2addresses:-198.51.100.224/28gcloud CLI
You can add more load-balancing address pools at any time for the bundledload balancers, but you can't remove any existing address pools. The flag thatyou specify ingcloud container bare-metal clusters update to add an addresspool depends on the type of bundled load balancer:
- MetalLB (layer 2): Use the
--metal-lb-address-poolsflag. - Border Gateway Protocol (BGP): Use the
--bgp-address-poolsflag.
The value for the flags have the following format:
'pool=NAME,avoid-buggy-ips=True|False,manual-assign=True|False,addresses=IP_ADDRESS_RANGE_1;IP_ADDRESS_RANGE_2;...' \
The value has segments that start with the keywordspool,avoid-buggy-ip,manual-assign, andaddresses. Separate each segmentwith a comma.
pool: A name of your choice for the pool.avoid-buggy-ips: If you set this toTrue, the IP address management(IPAM) controller won't assign IP addresses ending in.0or.255toServices. This avoids the problem of buggy consumer devices mistakenlydropping traffic sent to those special IP addresses. If not specified,defaults toFalse. Starting with Google Distributed Cloud version 1.16.0,you can modify this value in an existing address pool.manual-assign: If you don't want the IPAM controller toautomatically assign IP addresses from this pool to Services, setthis toTrue. Then a developer can create a Service of typeLoadBalancerand manually specify one of the addresses from thepool. If not specified,manual-assignis set toFalse.Starting with Google Distributed Cloud version 1.16.0, you can modifythis value in an existing address pool.In the list of
addresses: Each address must be a range either inCIDR orhyphenated-range format. To specify a single IP address in a pool(such as for the ingress VIP), use/32in CIDR notation(for example, 192.0.2.1/32).
Note the following syntax rules:
- Surround the entire value in single quotes.
- Whitespace isn't allowed.
- Separate each IP address range with a semicolon.
You can specify more than one instance of the flag, as shown in thefollowing example:
--metal-lb-address-pools='pool=pool2,avoid-buggy-ips=False,manual-assign=True,addresses=198.51.100.0/30;198.51.100.64-198.51.100.72'--metal-lb-address-pools='pool=pool3,avoid-buggy-ips=True,manual-assign=True,addresses=203.0.113.0/28'
For more information about load balancer address pools, seeloadBalancer.addressPoolsin Configure bundled load balancing.
Prevent inadvertent cluster deletion
bmctl
If you add thebaremetal.cluster.gke.io/prevent-deletion: "true" annotationto your cluster configuration file, you are prevented from deleting thecluster. For example, runningkubectl delete cluster orbmctl resetcluster produces an error.
apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:ci-10c3c6f4d9c698enamespace:cluster-ci-10c3c6f4d9c698eannotations:baremetal.cluster.gke.io/prevent-deletion:"true"spec:clusterNetwork:gcloud CLI
If you specify the--add-annotations flag with the valuebaremetal.cluster.gke.io/prevent-deletion="true", you are prevented fromdeleting the cluster. For example:
Add the annotation to prevent accidental cluster deletion:
gcloud container bare-metal clusters update abm-user-cluster1a \ --project=example-project-12345 \ --location=us-central1 \ --add-annotations=baremetal.cluster.gke.io/prevent-deletion="true"Attempt to delete the user cluster:
gcloud container bare-metal clusters delete abm-user-cluster1a \ --project=example-project-12345 \ --location=us-central1 \ --force \ --allow-missingThe response from the command is similar to the following:
ERROR: (gcloud.container.bare-metal.clusters.delete) INVALID_ARGUMENT:invalid request: admission webhook "vcluster.kb.io" denied the request:annotations[baremetal.cluster.gke.io/prevent-deletion]: Invalid value:"true": Annotation "baremetal.cluster.gke.io/prevent-deletion" should beremoved in order to delete this clusterTo remove the annotation, specify
--remove-annotations=baremetal.cluster.gke.io/prevent-deletion="true"in theupdatecommand.
Bypass preflight checks
This feature is available only withbmctl update.
The default value of thebypassPreflightCheckfield isfalse. If you set this field totrue in the cluster configurationfile, the internal preflight checks are ignored when you apply resources toexisting clusters.
apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:cluster1namespace:cluster-cluster1annotations:baremetal.cluster.gke.io/private-mode:"true"spec:bypassPreflightCheck:trueAdd or remove cluster administrators
bmctl
You can add or remove a user or service account as a cluster administratorfor a user cluster by specifying email addresses in theclusterSecurity.authorization.clusterAdmin.gcpAccountssection of the cluster configuration file. The accounts are granted thecluster-admin role on the cluster, providing full access to the cluster.
apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:cluster1namespace:cluster-cluster1spec:clusterSecurity:authorization:clusterAdmin:gcpAccounts:-alex@example.com-hao@example.com-my-sa@example-project-12345.iam.gserviceaccount.comWhen updating a user cluster to add an account, be sure to include allaccounts in the list (both existing and new accounts) becausebmctl updateoverwrites the list with what you specify in the configuration file. Toremove an account, remove it from the cluster configuration file and runbmctl update.
gcloud CLI
You can add or remove a user or service account as a cluster administratorby specifying an email addresses in the--admin-users flag. The flagaccepts only one email address. To add multiple users, specify one accountin each flag, for example:
gcloudcontainerbare-metalclustersupdateabm-user-cluster1a\--project=example-project-12345\--location=us-central1\--admin-users=alex@example.com\--admin-users=hao@example.com--admin-users=my-sa@example-project-12345.iam.gserviceaccount.comTheupdate command overwrites the whole grant list. Specify all existing andnew users who you want to be cluster administrators.
Set a login user
You can specify a non-root username that you want to use for passwordlesssudocapability access to the node machines in your cluster. Your SSH key,sshPrivateKeyPath,must work for the specified user. The cluster create and update operations checkthat node machines can be accessed with the specified user and SSH key.
bmctl
apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:cluster1namespace:cluster-cluster1annotations:baremetal.cluster.gke.io/private-mode:"true"spec:nodeAccess:loginUser:abmgcloud CLI
You specify the user that you want to use to access node machines in the--login-user flag, for example:
gcloudcontainerbare-metalclustersupdateabm-user-cluster1a\--project=example-project-12345\--location=us-central1\--login-user=abmTo enable passwordlesssudo access for a user, follow these steps on eachcluster node machine:
Use
sudo visudoto open the sudoers file for editing:sudovisudo-f/etc/sudoersThe
visudocommand locks the sudoers file to prevent simultaneous editsand validates the syntax of the file upon saving.For your login user, add an entry to the sudoers file like the following:
USERNAME ALL=(ALL) NOPASSWD: ALLClose and save the file.
To run commands with the privileges of your login user, run the followingcommand:
su-USERNAMETo verify that a password isn't required for your login user to run
sudocommands, run the followingsudocommand:sudoipa
Advanced networking
You configure advanced networking features in various custom resources afterthe cluster is created. To use the custom resources and related networkingfeatures, you must enable advanced networking when youcreate your cluster.
bmctl
SetclusterNetwork.advancedNetworkingtotruein the cluster configuration when you create your cluster:
apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:cluster1namespace:cluster-cluster1spec:clusterNetwork:...advancedNetworking:true...gcloud CLI
Include the--enable-advanced-networking flag inthegcloud container bare-metal clusters create command when you create your cluster.
After the cluster is created with advanced networking enabled, you canconfigure the custom resources described in this section usingkubectl apply.
gcloud container bare-metal clusters update command doesn't supportconfiguring these custom resources.NetworkGatewayGroup
TheNetworkGatewayGroup custom resource is used to provide floating IPaddresses for advanced networking features, such as theegress NAT gateway or thebundled load-balancing feature with BGP.
apiVersion:networking.gke.io/v1kind:NetworkGatewayGroupname:defaultnamespace:cluster-bmspec:floatingIPs:-10.0.1.100-10.0.2.100BGP load balancing
You configure Border Gateway Protocol (BGP) load balancing in the clusterresource and other custom resources. Thegcloud container bare-metal clusterscreate and theupdate commands support configuring BGP in the clusterresource, but not the custom resources.
When you configure bundled load balancers with BGP, the data plane loadbalancing uses, by default, the same external peers that were specified forcontrol plane peering. Alternatively, you can configure the data plane loadbalancing separately, using theBGPLoadBalancer custom resource and theBGPPeer custom resource. For more information, seeConfigure bundled load balancers with BGP.
BGPLoadBalancer
apiVersion:networking.gke.io/v1kind:BGPLoadBalancermetadata:name:defaultnamespace:cluster-bmspec:peerSelector:cluster.baremetal.gke.io/default-peer:"true"BGPPeer
apiVersion:networking.gke.io/v1kind:BGPPeermetadata:name:bgppeer1namespace:cluster-bmlabels:cluster.baremetal.gke.io/default-peer:"true"spec:localASN:65001peerASN:65002peerIP:10.0.3.254sessions:2Increase service network range
To create more services than the initial limit, you can reduce the IPv4 serviceCIDR mask to increase the service network of your cluster. Reducing the mask(the value after "/") results in a bigger network range. You can onlyincrease the range of the IPv4 service CIDR. The network rangecan't be reduced, which means the mask (the value after "/") can't be increased.
bmctl
apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:cluster1namespace:cluster-cluster1spec:...clusterNetwork:services:cidrBlocks:-192.0.2.0/14...gcloud CLI
To increase the range of the IPv4 service CIDR on a user cluster, specifythe new range in the--island-mode-service-address-cidr-blocks flag.
gcloudcontainerbare-metalclustersupdatecluster1\--project=example-project-12345\--location=us-central1\--island-mode-service-address-cidr-blocks=192.0.2.0/14Configure kubelet image pull settings
The kubelet runs on each node of your cluster. The kubelet is responsible formonitoring containers on a node and making sure they are healthy. When needed,the kubelet queries and pulls images from the Artifact Registry.
Updating your kubelet configurations manually and keeping them synchronizedacross all of your cluster nodes can be challenging. To make matters worse,manual kubelet configuration changes on your nodes are lost when you upgradeyour cluster.
To help make synchronized updates easier and persistent, Google Distributed Cloudlets you specify some kubelet settings for each of your cluster node pools:control plane nodes, load balancer nodes, and worker nodes. The settings applyfor all nodes in a given pool and persist through cluster upgrades. The fieldsfor these settings are mutable, so you can update them at any time, not justduring cluster creation.
bmctl
The following supported fields control Artifact Registry pull operations forkubelet:
Warning: SettingregistryBurst orregistryPullQPS to a negative valueresults in update job failures for the kubelet configuration. To fix the issue,either update these fields to positive values or remove them from the spec. Ifthe update job is left to fail for a long time, it can fill up the machine diskspace with kubelet configuration backup files. You can find these backup filesin/var/lib/kubelet/config.yaml.bkup.*. If these backup files are taking uptoo much disk space, you can remove them.registryBurst(default: 10)registryPullQPS(default: 5)serializeImagePulls(default: true)
For more information about each of the kubelet configuration fields, see theCluster configuration field reference.
You can specify these fields inkubeletConfig sections of the Cluster spec andthe NodePool spec for the following pools of nodes:
- Cluster spec:
- Control plane nodes
spec.controlPlane.nodePoolSpec.kubeletConfig - Load balancer nodes
spec.loadBalancer.nodePoolSpec.kubeletConfig - NodePool spec:
- Worker nodes
spec.kubeletConfig
The following example shows the added fields with theirdefault values inthe cluster configuration file. Note that the annotationpreview.baremetal.cluster.gke.io/custom-kubelet: "enable" is required.
apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:cluster1namespace:cluster-cluster1annotations:preview.baremetal.cluster.gke.io/custom-kubelet:"enable"spec:...controlPlane:nodePoolSpec:kubeletConfig:registryBurst:10registryPullQPS:5serializeImagePulls:true...loadBalancer:nodePoolSpec:kubeletConfig:registryBurst:10registryPullQPS:5serializeImagePulls:true...apiVersion:baremetal.cluster.gke.io/v1kind:NodePoolmetadata:name:node-pool-newnamespace:cluster-cluster1spec:clusterName:cluster1...kubeletConfig:registryBurst:10registryPullQPS:5serializeImagePulls:trueIn each case, the setting applies to all nodes in the pool.
gcloud CLI
The following flags control Artifact Registry pull operations forkubelet:
Control plane nodes
Load balancer nodes
- --bgp-load-balancer-registry-burst
- --bgp-load-balancer-registry-pull-qps
- --disable-bgp-load-balancer-serialize-image-pulls
- --enable-bgp-load-balancer-serialize-image-pulls
- --metal-lb-load-balancer-registry-burst
- --metal-lb-load-balancer-registry-pull-qps
- --disable-metal-lb-load-balancer-serialize-image-pull
- --enable-metal-lb-load-balancer-serialize-image-pulls
Worker nodes
*-registryburst or*-registry-pull-qps flags to anegative value results in update job failures for the kubelet configuration.To fix the issue, update these fields to positive values. If the update job isleft to fail for a long time, it can fill up the machine disk space withkubelet configuration backup files. You can find these backup filesin/var/lib/kubelet/config.yaml.bkup.*. If these backup files are taking uptoo much disk space, you can remove them.How to use
Here are some considerations for tuning image pulls:
Since images are pulled in series by default, an image pull that takes a longtime can delay all other image pulls scheduled on a node. Delayed image pullscan block the upgrade process (especially when new Google Distributed Cloudimages need to be deployed on a node). If you're affected by image pulldelays, you can disable serialize image pulls to allow parallel imagepulls.
If you're encountering image pull throttling errors, such as
pull QPSexceeded, you may want to increase*-registry-pull-qpsand*-registry-burstto increase image pull throughput. These two fields adjustthe pull rate and queue size and may help to address other throttling relatedissues.Negative values aren't allowed.
Keepalived customization
Starting in version 1.32, Google Distributed Cloud provides some customization ofthe Keepalived configuration. With bundled load balancing, the control planeload balancer serves the control plane virtual IP (VIP) address.Google Distributed Cloud runs Keepalived and HAProxy as Kubernetes static Pods onthe load balancer nodes to announce the control plane VIP. Keepalived uses theVirtual Router Redundancy Protocol (VRRP) on the load balancer nodes for highavailability.
Version 1.32 and later clusters have the following Keepalived customizations:
For high availability control planes, Google Distributed Cloud automaticallyconfigures the Keepalived VRRP configuration to make failover behaviourdeterministic and prevent interleaving of ARP replies with different MACaddresses:
Each Keepalived instance is configured automatically with a different
priorityvalue in the VRRP router.Each Keepalived instance is configured automatically with
nopreempttoavoid elections when a non-master instance is restarted.
Google Distributed Cloud lets you specify the number of gratuitous ARP (GARP)messages to send at a time after a control plane node transitions to therole of the master server. To change the number of GARP messages to send,add the
controlPlane.loadBalancer.keepalivedVRRPGARPMasterRepeatfield to the cluster configuration file, set it to the new value, and updateyour cluster. This value maps to thevrrp_garp_master_repeatsetting forKeepalived. The default value is 5.The following example shows how to specify
keepalivedVRRPGARPMasterRepeatin the cluster configuration file:apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:hybrid-ha-lbnamespace:cluster-hybrid-ha-lbspec:type:hybridprofile:defaultanthosBareMetalVersion:1.33gkeConnect:projectID:project-fleetcontrolPlane:loadBalancer:keepalivedVRRPGARPMasterRepeat:1nodePoolSpec:nodes:-address:10.200.0.2-address:10.200.0.3-address:10.200.0.4...
Install or uninstall the bundled NVIDIA GPU Operator
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
TheNVIDIA GPU Operatorlets you run GPU-related workloads in your clusters. Starting withGoogle Distributed Cloud version 1.33.0, clusters are bundled with a completeNVIDIA GPU Operator stack to provide a managed solution for handling the NVIDIAsoftware components needed to provision GPUs on your cluster worker nodes.
Important: Don't install the bundled NVIDIA GPU Operator if you intend to manuallyinstall and maintain the NVIDIA GPU Operator yourself. If you prefer to install andmanage the NVIDIA GPU Operator manually, seeSet up and use NVIDIAGPUs for instructions.Prerequisites
Before installing the the bundled NVIDIA GPU Operator, make sure your environment meetsthe following requirements:
Operational cluster: You have a functional bare metal cluster createdwith Google Distributed Cloud.
NVIDIA GPUs: The NVIDIA GPUs are installed on your cluster worker nodes.The following section for installing the NVIDIA GPU Operator includes steps toverify that the GPUs are installed properly and recognized by your operatingsystem.
Compatible NVIDIA driver version: The NVIDIA driver version you use mustbe compatible with your GPU, your operating system, and the CUDA versionyour applications use. For more information, seeVersioninformation.
You have the following NVIDIA driver installation options:
Use the NVIDIA driver preinstalled in your operating system image.
Use the instructions in theNVIDIA Driver Installation QuickstartGuideto manually install the NVIDIA driver.
The NVIDIA GPU driver must be installed and ready before you enable thebundled NVIDIA GPU Operator.
Version information
This section contains software version information for the bundled NVIDIA GPU Operator.
Software component versions
Google Distributed Cloud release version 1.33 bundles version 25.3.1 of theNVIDIA GPU Operator. In Google Distributed Cloud, the bundle contains the followingimages:
- NVIDIA Container Toolkit version v1.17.8
- NVIDIA DCGM Exporter v3.3.9-3.6.1
- NVIDIA Kubernetes Device Plugin v0.17.1
- Node Feature Discovery v0.17.2
The image versions bundled with Google Distributed Cloud release 1.33 might notmatch exactly with the software component versions listed in the25.3.1 releasenotes.
Driver compatibility
SeePlatform Support for version25.3.1on the NVIDIA Docs Hub for drivers compatibility information.
Updating the bundled NVIDIA GPU Operator
If you have installed NVIDIA GPU Operator on your cluster, when you upgrade to a newminor version, the latest bundled version of the NVIDIA GPU Operator is installed.
Install the bundled operator
While the bundled NVIDIA GPU Operator is in Preview, you install it by usingbmctl update to add the following annotation to the cluster that has GPUnodes:
apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:cluster1namespace:cluster-cluster1annotations:preview.baremetal.cluster.gke.io/nvidia-gpu-operator:"enable"spec:...The NVIDIA GPU Operator stack is installed to the cluster when the annotation applied.
Uninstall the bundled operator
While the bundled NVIDIA GPU Operator is in Preview, you uninstall it by usingbmctl update to remove the following annotation from the cluster that has GPUnodes:
preview.baremetal.cluster.gke.io/nvidia-gpu-operator:"enable"All components of the NVIDIA GPU Operator stack are removed from the cluster when theannotation is removed.
Enable dynamic resource allocation
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
Dynamic resource allocation is a Kubernetes API that lets you request and share genericresources, such as GPUs, among Pods and containers. Third-party drivers managethese resources. This capability helps you run AI workloads by dynamically andprecisely allocating the GPU resources within your bare metal clusters,improving resource utilization and performance for demanding workloads.
Dynamic resource allocation is available for preview for version 1.33 and later clusters. Thefollowing instructions describe how to configure your cluster to use dynamic resource allocation.After it's enabled, you can configure your GPU workloads to use dynamic resource allocation.
Configure your cluster to enable dynamic resource allocation:
Edit your cluster configuration file to include the
preview.baremetal.cluster.gke.io/dynamic-resource-allocation: "enable"preview annotation and addDynamicResourceAllocation: trueunderfeatureGatesin thekubeletConfigsection:apiVersion:baremetal.cluster.gke.io/v1kind:Clustermetadata:name:dranamespace:cluster-draannotations:preview.baremetal.cluster.gke.io/dynamic-resource-allocation:"enable"spec:controlPlane:nodePoolSpec:kubeletConfig:featureGates:DynamicResourceAllocation:true# ... other cluster configurationUpdate the cluster by running the
bmctl updatecommand:bmctlupdatecluster-cCLUSTER_NAME\--kubeconfig=ADMIN_KUBECONFIGReplace the following:
CLUSTER_NAME: the ame of the user cluster you areupdating.ADMIN_KUBECONFIG: the path of the admin clusterkubeconfig file.
After you apply this configuration, the
READYfield for your bare metalmachines might switch betweenTrueandFalsemultiple times. Wait fortheREADYfield to stabilize onTruebefore proceeding.To enable the
DynamicResourceAllocationfeature gate in node pools that havenodes with GPUs, setDynamicResourceAllocationtotruein thefeatureGatessection of thekubeletConfigsection of the NodePool spec:For instructions to add and update a node pool, seeManage node pools in acluster.
apiVersion:baremetal.cluster.gke.io/v1kind:NodePoolmetadata:name:npnamespace:cluster-draspec:clusterName:drakubeletConfig:featureGates:DynamicResourceAllocation:truenodes:# ... other node pool configurationAfter you have added or updated the node pool, wait for all bare metalmachines in the node pool to reach a
Readystatus.To check the status of your cluster bare metal machines, use the following command:
kubectlgetbaremetalmachines--kubeconfigADMIN_KUBECONFIG-AWhen the bare metal machines are ready, the response should look similar tothe following sample response:
NAMESPACE NAME CLUSTER READY INSTANCEID MACHINE ABM VERSION DESIRED ABM VERSIONcluster-admin 10.200.0.2 dra true baremetal://10.200.0.2 10.200.0.2 1.33.0-gke.793 1.33.0-gke.793cluster-user-dra 10.200.0.6 user-dra true baremetal://10.200.0.6 10.200.0.6 1.33.0-gke.793 1.33.0-gke.793cluster-user-dra 10.200.0.7 user-dra true baremetal://10.200.0.7 10.200.0.7 1.33.0-gke.793 1.33.0-gke.793cluster-user-dra 10.200.0.8 user-dra true baremetal://10.200.0.8 10.200.0.8 1.33.0-gke.793 1.33.0-gke.793
Limitations
The bundled NVIDIA GPU Operator has the following limitations:
The bundled NVIDIA GPU Operator supports the following NVIDIA software componentsonly:
- NVIDIA Container Toolkit
- NVIDIA DCGM Exporter
- NVIDIA Kubernetes Device Plugin
- NVIDIA MIG Manager for Kubernetes.
DuringPreview,the NVIDIA GPU Operator configuration is fixed. If you attempt to customize anysettings, they are reconciled back to the original installation settings.
The bundled NVIDIA GPU Operator can't be used to install NVIDIA GPU drivers.
During Preview, this feature uses the
resource.k8s.io/v1beta1API group,which differs from the open source Kubernetes API group for this feature,resource.k8s.io/v1. Thev1open source API group provides more featuresand better stability than thev1beta1API group.
What's next
To use dynamic resource allocation with your GPU workloads, seeManage GPU devices withdynamic resource allocation.
To learn more about dynamic resource allocation, seeDynamic ResourceAllocationin the Kubernetes documentation.
Reference documentation
bmctl
gcloud CLI
Terraform
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-11-24 UTC.