You can diagnose and resolve issues with active and standby capacity buffers in
Google Kubernetes Engine (GKE), including provisioning, scheduling, resumption, and
DaemonSet connection failures. The troubleshooting sections in this document
apply to both standalone CapacityBuffers and buffers configured in custom
ComputeClasses. For configuration errors specific to custom ComputeClasses, such
as spec.buffers field rejections, BuffersConfigured condition reasons, and
provisioning strategy errors, see
Troubleshoot capacity buffer issues
in "Troubleshoot custom ComputeClass issues."
This document is for platform administrators, cluster operators, and application developers who manage capacity buffers or workloads that depend on them. For more information about common roles and example tasks in Google Cloud content, see Common GKE user roles and tasks.
Capacity buffer not ready due to billing model
If you create a CapacityBuffer for a workload or PodTemplate that uses the
Pod-based billing model,
then the capacity buffer isn't ready for provisioning. Capacity buffers support
only workloads that use the node-based billing model, such as Standard
node pools or Autopilot node pools that select specific hardware.
GKE can't provision capacity buffers for workloads that run on
built-in Autopilot ComputeClasses or custom ComputeClasses that use
podFamily priority rules.
To identify this issue, inspect the CapacityBuffer status:
kubectl describe capacitybuffer \
CAPACITY_BUFFER_NAME \
-n NAMESPACE
Replace the following:
CAPACITY_BUFFER_NAME: the name of your CapacityBufferNAMESPACE: the namespace of your CapacityBuffer
In the status.conditions output, inspect the ReadyForProvisioning condition.
If the ReadyForProvisioning condition has a status of False, then the
referenced workload or PodTemplate doesn't use the node-based billing model.
If you configured buffers by using the spec.buffers field in a custom
ComputeClass and encounter a billing model error, then check the
BuffersConfigured condition in the status of your ComputeClass. For more
information, see
Check BuffersConfigured condition reasons.
To resolve this issue, update your CapacityBuffer to reference a workload or PodTemplate that uses the node-based billing model, and then apply the manifest.
To verify the fix, inspect the CapacityBuffer status again:
kubectl describe capacitybuffer \
CAPACITY_BUFFER_NAME \
-n NAMESPACE
Replace CAPACITY_BUFFER_NAME and
NAMESPACE with the values that you used earlier in
this section.
If the ReadyForProvisioning condition has a status of True, then the buffer
is ready for provisioning.
Buffer Pods aren't scheduled on nodes provisioned by custom ComputeClasses
If the workload or PodTemplate that your CapacityBuffer references selects a custom ComputeClass, then simulated buffer Pods might fail to schedule on newly provisioned nodes. When this scheduling failure occurs, the cluster autoscaler repeatedly creates redundant node pools and nodes while deleting idle nodes.
This issue occurs when a custom ComputeClass provisions nodes that have taints or specific runtime requirements. If the referenced workload or PodTemplate lacks matching tolerations, node selectors, or runtime classes, then buffer Pods can't schedule on those nodes.
To identify this mismatch, do the following:
- In your CapacityBuffer manifest, find the workload or PodTemplate that the
buffer references in the
spec.podTemplateReforspec.scalableReffield. - Compare the Pod specification in that workload or PodTemplate with your custom ComputeClass manifest. If the ComputeClass defines node taints or runtime requirements that the Pod specification omits, then buffer Pods can't schedule on the provisioned nodes.
To resolve this issue, update the referenced workload or PodTemplate to include the required tolerations, node selectors, or runtime classes, and then apply the updated manifest. For example, if the workload or PodTemplate selects a ComputeClass that enables GKE Sandbox, then update the Pod specification to do one of the following:
- Set the value of the
spec.runtimeClassNamefield togvisor. - Add an explicit toleration for the
sandbox.gke.io/runtime=gvisor:NoScheduletaint.
To verify the fix, monitor your cluster's node pools and confirm that the cluster autoscaler stops creating and deleting redundant idle nodes.
For more information about custom ComputeClass configuration options, see About custom ComputeClasses.
Standby buffer nodes fail to resume
Suspended standby buffer nodes might fail to resume for one of the following reasons:
- Resuming a suspended standby node requires available Compute Engine capacity in the node's zone for the exact machine type and CPU platform generation, such as within the E2 or N2 series. If the zone lacks compute capacity for that exact configuration, then the node fails to resume. For more information, see Compute Engine suspend and resume limitations.
- If the priority rules in your custom ComputeClass use Spot VMs, then standby buffer nodes on Spot VMs might fail to resume when Spot VM capacity is unavailable. Suspended Spot VMs can't resume as on-demand VMs.
- If your ComputeClass sets the
activeMigration.optimizeRulePriorityfield totrueand prioritizes Spot VMs over on-demand VMs, then GKE gradually migrates on-demand standby nodes to Spot VMs. Those migrated nodes might fail to resume when Spot VM capacity is unavailable. For more information, see Active migration to higher priority nodes. - Resuming the node exceeds your project's Compute Engine quotas.
To identify why a standby node failed to resume, query
Compute Engine audit logs in
Logs Explorer for compute.instances.resume operations. Inspect the results
for the following errors:
- If the logs show
ZONE_RESOURCE_POOL_EXHAUSTEDerrors, then the zone has insufficient capacity for that node's machine type or CPU platform generation, or Spot VM capacity is unavailable. - If the logs show
QUOTA_EXCEEDEDerrors, then your project doesn't have enough Compute Engine quota to resume the node. For resolution steps, see Capacity buffer fails to provision due to quota limits.
To resolve or mitigate capacity-related resumption failures, do one or more of the following:
- Use regional clusters so that the cluster autoscaler can provision or resume nodes across multiple zones.
- Configure multiple machine families in the
spec.prioritieslist of your custom ComputeClass. If suspended nodes can't resume, then the cluster autoscaler can fall back to creating new nodes based on another priority rule. These new nodes take longer to become ready than resumed standby nodes. This fallback doesn't help suspended nodes resume, because a suspended node can resume only by using its original machine type. - Use a dedicated custom ComputeClass for on-demand VMs, or set the value of
the
activeMigration.optimizeRulePriorityfield tofalsein the ComputeClass that your standby buffer uses. - Use a small active buffer alongside your standby buffer to absorb immediate traffic spikes.
To verify the fix, monitor compute.instances.resume audit log entries in
Logs Explorer and confirm that ZONE_RESOURCE_POOL_EXHAUSTED and
QUOTA_EXCEEDED errors no longer occur when workloads scale up.
Pods fail to start or start late after a standby node resumes
In clusters with Calico network policy enforcement, Calico tokens can expire while standby buffer nodes are suspended. In GKE version 1.37.2-gke.1325000 and later, expired Calico tokens on resumed nodes can delay Pod startup by about 60 seconds. In earlier versions, Pods might fail to start on resumed nodes.
To mitigate this issue, do one of the following:
- For GKE version 1.37.2-gke.1325000 and later, set the refresh interval to less than 22 hours.
- For versions earlier than 1.37.2-gke.1325000, set the refresh interval to less than 10 hours.
- Use the GKE Dataplane V2 network plugin instead of Calico.
You can't control how standby buffers start and refresh when they're configured by using a ComputeClass. To customize the refresh interval when you use a custom ComputeClass, create a CapacityBuffer yourself instead of creating buffers by using a ComputeClass.
Capacity buffer fails to provision due to quota limits
If a capacity buffer exceeds Kubernetes ResourceQuotas or Compute Engine quotas, then the buffer might provision fewer replicas than you requested or fail to scale up.
To identify which quota is limiting the buffer, check one or both of the following quotas:
Check whether a Kubernetes ResourceQuota in the namespace is limiting the buffer:
kubectl describe capacitybuffer \ CAPACITY_BUFFER_NAME \ -n NAMESPACEReplace the following:
CAPACITY_BUFFER_NAME: the name of your CapacityBufferNAMESPACE: the namespace of your CapacityBuffer, orgke-managed-cccfor buffers managed by a custom ComputeClass
If the
status.conditionsoutput includes aLimitedByQuotascondition that has a status ofTrue, then the buffer exceeds the namespace ResourceQuota. GKE caps thestatus.replicasfield to fit within the available quota. Both active and standby buffer units, including units backed by suspended standby nodes, count toward namespace ResourceQuota limits as if the buffer Pods were running.Check whether Compute Engine project quotas block node provisioning. In Cloud Logging, open Logs Explorer and search the
container.googleapis.com/cluster-autoscaler-visibilitylog forno.scale.up.nap.quota.exceededevents, or search Compute Engine audit logs forQUOTA_EXCEEDEDerrors. If either log shows quota errors, then your project has reached a Compute Engine quota limit.When you check Compute Engine quotas for standby buffers, verify both of the following quotas in addition to vCPU and memory quotas:
- Suspended standby nodes retain their internal and external IP addresses, which consumes the in-use IP address quota.
- When Compute Engine suspends a standby VM,
Compute Engine writes the node's memory to disk. This operation
consumes
Persistent disk standard (GB)disk quota proportional to the node's memory size.
To resolve the quota limit, do one of the following:
- Increase the Kubernetes ResourceQuota in the buffer's namespace.
- Request a Compute Engine quota adjustment.
- Reduce the values of the
spec.replicas,spec.limits, orspec.percentagefields in your CapacityBuffer manifest. - Reduce the
cpuormemoryvalues in thespec.buffers.limitsfield of your custom ComputeClass manifest.
To verify the fix, inspect the CapacityBuffer status again:
kubectl describe capacitybuffer \
CAPACITY_BUFFER_NAME \
-n NAMESPACE
Replace CAPACITY_BUFFER_NAME and
NAMESPACE with the values that you used earlier in
this section.
If the LimitedByQuotas condition is no longer True and the status.replicas
field matches your expected replica count, then the quota limit is resolved.
DaemonSet Pods stop receiving data after a standby node resumes
After a suspended standby buffer node resumes, DaemonSet Pods on that node might stop receiving data over long-lived connections that were opened before the node was suspended. The Pods don't log any errors and don't reconnect.
This issue occurs when a DaemonSet Pod acts as a receive-only client, such as for a streaming HTTP response, a WebSocket connection, server-sent events, or a gRPC server-streaming call. While the standby node is suspended, the server or an intermediate network device times out and closes the connection. When the node resumes, the network stack in the Pod still considers the connection open. Because the Pod doesn't send any data, the Pod doesn't detect that the connection closed and waits for data indefinitely.
To resolve this issue, configure the client application in the Pod to detect closed connections and reconnect by doing one of the following:
Configure client-side TCP keepalive in your client application. Enabling keepalive only on the server doesn't notify the Pod. To configure client-side keepalive, do the following:
- Enable the
SO_KEEPALIVEsocket option in your client library or language runtime. For example, use thesocket.setKeepAlive(true, initialDelay)method in Node.js or thenet.Dialer.KeepAlivefield in Go. Some runtimes disable TCP keepalive by default. - Configure a short keepalive idle time by setting the
TCP_KEEPIDLEoption to a few seconds instead of relying on the operating system default. - Configure your application so that when a keepalive probe fails, the application catches the connection reset or timeout error, and then opens a new connection.
For more information about TCP keepalive parameters, see Idle connections.
- Enable the
Configure application-level heartbeats or read timeouts in your client, such as WebSocket ping and pong frames or gRPC keepalive pings. Update your application so that if a timeout occurs, then the client reconnects.
To verify the fix, check your DaemonSet Pod logs and metrics after a standby node resumes during a workload scale-up event. If the Pod reconnects and continues receiving data, then the keepalive or heartbeat configuration works as expected.
What's next
- Diagnose
spec.buffersfield andBuffersConfiguredcondition issues. See Troubleshoot capacity buffer issues in "Troubleshoot custom ComputeClass issues." - Create and manage CapacityBuffers directly in Configure capacity buffers.
- Add buffers to a custom ComputeClass in Configure capacity buffers in custom ComputeClasses.
- Read how active and standby buffers work in About capacity buffers.
Investigate general node scale-up failures in Troubleshoot cluster autoscaler not scaling up.
If you can't find a solution to your problem in the documentation, see Get support for further help, including advice on the following topics:
- Opening a support case by contacting Cloud Customer Care.
- Getting support from the community by
asking questions on StackOverflow
and using the
google-kubernetes-enginetag to search for similar issues. You can also join the#kubernetes-engineSlack channel for more community support. - Opening issues or feature requests by using the public issue tracker.