ComputeClass: CRD Fields & Spec Reference
Full CRD: kubectl describe crd computeclasses.cloud.google.com.
Minimal Shape
apiVersion: cloud.google.com/v1
kind: ComputeClass
metadata: { name: my-class }
spec:
nodePoolAutoCreation: { enabled: true }
priorities:
- machineFamily: n4
minCores: 16
Top-Level Spec Fields
| Field | Purpose | Default / Note |
|---|---|---|
nodePoolAutoCreation.enabled |
Enable node pool | false |
| : : auto-creation for : : | ||
| : : this ComputeClass. : : | ||
| : : **Does NOT require : : | ||
| : : cluster-level Node : : | ||
| : : Auto Provisioning.** : : | ||
nodePoolConfig |
Defaults for node | See below. |
| : : pool auto-creation : : | ||
| : : pools (image, SA, : : | ||
| : : labels, taints). : : | ||
priorityDefaults |
Defaults applied to | e.g. zones, |
: : all priorities[] : sysctls. : |
||
| : : entries. : : | ||
priorities[] |
Ordered list of | Tried top-to-bottom. |
| : : provisioning : : | ||
| : : attempts. : : | ||
autoscalingPolicy |
Consolidation | 1 min floor. |
| : : thresholds and : : | ||
| : : delay. : : | ||
activeMigration |
Drift logic to | Honors PDBs. |
| : : higher priorities. : : | ||
whenUnsatisfiable |
Fallback behavior | DoNotScaleUp |
| : : when priorities : (Default). : | ||
| : : exhaust. : : |
nodePoolConfig (node pool auto-creation Only)
Applied to pools created by the autoscaler.
imageType:cos_containerd,ubuntu_containerd(must be lowercase).nodeLabels: Key-value pairs.taints: List of{ key, value, effect }. Valid for an intentional dedication taint; keys cannot containkubernetes.io(GKE Warden rejects it). DO NOT re-addcloud.google.com/compute-classon auto-created pools — GKE applies and auto-tolerates it. (Manual pools, by contrast, REQUIRE it as label + taint to bind.)serviceAccount: Identity for nodes (use custom SA with least privilege, not default).
priorities[] Fields
machineFamily/machineType: Intent vs. strict. Prefer family.minCores,minMemoryGb: Lower bounds for intent-based matching.spot:truefor Spot,falsefor On-Demand.location.zones: List of zones to attempt. Cannot combine withreservations.affinity: Specific(error: location config with specific reservations enabled) — with Specific reservations, zones come fromreservations.specific[].zonesand you keep only a policy-onlylocation.locationPolicy.location.locationPolicy:ANY(default; packs for utilization, tends to fill one zone) orBALANCED(best-effort even node spread across zones at scale-up — infrastructure layer; still scales up if a zone is short). Balances nodes, not pods — for even pod distribution add podtopologySpreadConstraints/DoNotSchedule(workload layer).reservations:affinity: SpecificorNone.flexStart:{ enabled: true }for DWS queued provisioning.gpu/tpu: Accelerator requests (count, type, topology).nodepools: (Standard Only) List of manual pool names to target.nodeSystemConfig:linuxNodeConfig:sysctls(e.g.,net.ipv4.tcp_tw_reuse: true,net.core.somaxconn: 4096). Never quote integer or boolean values.kubeletConfig:cpuCfsQuota,podPidsLimit, etc.
storage: SetbootDiskType,bootDiskSize, andlocalSSDCountspecifically for this priority. Overrides cluster/nodePoolConfig defaults. This is the NODE boot disk, NOT the workload's data PV — for attached PVs use a KubernetesStorageClass(recommend the built-indynamic-rwowithuse-allowed-disk-topology: "true"on GKE 1.35.3-gke.1290000+; see provisioning methods).
Important Schema Constraints
- Case Sensitivity:
imageTypemust be lowercase (e.g.,cos_containerd). - Field Hallucinations: NEVER use
spec.description,gvnic,transparentHugepageEnabled, orshutdownGracePeriodSeconds. They do not exist in the CRD. - YAML Formatting: ALWAYS use literal integers for fields like
bootDiskSize,minCores, andsomaxconn. DO NOT wrap them in quotes.- Correct:
bootDiskSize: 50 - Incorrect:
bootDiskSize: "50"
- Correct:
- Storage: Use
bootDiskSize, NOTbootDiskSizeGb.
whenUnsatisfiable
DoNotScaleUp(Default): Pods stayPending. Best for specific hardware needs.ScaleUpAnyway: Provisions E2 nodes on Standard with node pool auto-creation. Avoid for specialized workloads.