All skills
google avatar

/gke-compute-classes

@becc4b8
by googlegoogle/skills21k stars
1,698

Configures, optimizes, and troubleshoots GKE ComputeClasses. Use when configuring Spot VMs with on-demand fallback, targeting specific accelerators (GPUs/TPUs) or machine families, restricting ComputeClass access, or debugging pending pods related to node pool auto-creation. Do not use for cluster-level Node Auto Provisioning configuration or general GKE cluster creation.

Use this Skill: https://skilld.dev/gh/google/skills/gke-compute-classes

This session only. Nothing lands on disk.

referencescompute-class-karpenter-migration.md

≈916 tokens on demand. Your agent reads this file only when SKILL.md points to it.

ComputeClass: Migrating from Karpenter

Concept Mapping

Karpenter GKE ComputeClass Note
NodePool ComputeClass Collapse multiple
: : : NodePools into :
: : : priorities[]. :
spec.weight Order in priorities[] Top wins. Strictly
: : : ordered traversal. :
`instance-family In machineFamily: n4 GCP equivalents: m6i
: [m6i] : : ->n4, c6i` -> :
: : : c4. :
capacity-type: spot spot: true Declare per priority.
`consolidateAfter: `consolidationDelayMinutes: Floor is 1 minute.
: 30s : 1 : :
drift `activeMigration: { Honors PDBs.
: : optimizeRulePriority: true : :
: : }` : :
disruption.budgets **PodDisruptionBudget Standard K8s resource.
: : (PDB)** : :

Family Translation (AWS -> GCP)

  • General Purpose: m5/m6i -> n2 / n4.
  • Compute Optimized: c5/c6i -> c2 / c4.
  • AMD: m5a/m6a -> n2d / n4d.
  • ARM: c7g/m7g -> c4a / n4a.
  • Memory Optimized: r5/r6i -> n2-highmem / n4-highmem.

Key Behavioral Differences

  • Fast-fail Traversal: ComputeClass falls through to next priority immediately on failure. No probabilistic selection.
  • Spec Changes: Updating ComputeClass doesn't drift nodes automatically unless activeMigration is enabled.
  • Drift Throttling: GKE does not have a global drift delay (like 'consolidateAfter'). You must use PDBs on your deployments to throttle activeMigration (drift) rates.
  • Spot vs OD: On GCP, Spot/OD often share capacity for CPU. Always include an OD floor.
  • No Topology in ComputeClass: Set topologySpreadConstraints on the Pod, not the ComputeClass.
  • whenUnsatisfiable: Karpenter's "any VM" doesn't match GKE's ScaleUpAnyway (which picks E2). Use DoNotScaleUp and accept Pending.

Sharp Edge: translate Pod selectors to GKE-native labels

The #1 post-migration trap. Karpenter/EKS Pod nodeSelector/affinity uses AWS-style or generic keys that GKE's autoscaler does not recognize — the Pod stays Pending with noScaleUp (no priority matches).

  • Machine family: generic machine-family: c4 → GKE cloud.google.com/machine-family: c4.
  • Machine shape/type: AWS node.kubernetes.io/instance-type: m6i.4xlarge → GKE shape node.kubernetes.io/instance-type: n4-standard-16 (both keys are real: cloud.google.com/machine-family = family, node.kubernetes.io/instance-type = shape).
  • Better: drop the node-label selector entirely and select the ComputeClass — nodeSelector: { cloud.google.com/compute-class: <NAME> } — letting priorities[] choose the family/shape.
  • GPU Pods: also add the GPU toleration (nvidia.com/gpu: Exists) — GKE auto-taints GPU nodes; missing it is another common noScaleUp cause (see SKILL CRITICAL GPU-TAINT RULE).

Source: SKILL.md on GitHub

1 warning9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    This skill provides a robust framework for managing GKE ComputeClasses. It includes security considerations such as the ingestion of external logs and YAML for analysis, which are mitigated by specific instructions to treat user input as untrusted. The use of a shell script to access infrastructure logs is a standard diagnostic practice for cloud management.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: MEDIUM · 1 issue

Signed by skilld at becc4b8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 weeks ago
metadata
{
  "version": "1.0.0",
  "category": "Containers"
}

README badge

README badge for google/skills/gke-compute-classes