[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M720TYBPBFM8GXES0M4W439V":3,"skill-same:01M720TYBPBFM8GXES0M4W439V":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M720TYBPBFM8GXES0M4W439V","capacity-obtainability",null,"Check GKE quota and live hardware obtainability before recommending capacity, and plan future capacity windows for deadline-bound batch jobs. Use when a cluster design, capacity plan, scale-up decision, GPU\u002FTPU batch schedule, or a free-standing availability question needs live evidence: regional quota verification (gcloud compute regions describe), reservations, capacity obtainability advice (gcloud beta compute advice capacity \u002F capacity-history) across zones and provisioning models, and future window advice (gcloud beta compute advice calendar-mode) for \"when will this shape be obtainable\". For handling an inbound cluster-autoscaler stockout alert end to end — triage, GitOps remediation, Pull Request — use the gke-stockout-investigator plugin skill instead.","gke-labs\u002Fkube-agents","gke-labs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F197140281?v=4","01M720MEZR8K6WD2WTHNQE346Q","01M720MF0BRA9RGH1QVT4J0M0E",126,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fgke-labs\u002Fkube-agents\u002Fblob\u002Fmain\u002Fagents\u002Fplatform\u002Fskills\u002Fcapacity-obtainability\u002FSKILL.md",[],[],"2026-11-10 18:39:20",false,"---\nname: capacity-obtainability\ndescription: >-\n  Check GKE quota and live hardware obtainability before recommending\n  capacity, and plan future capacity windows for deadline-bound batch jobs.\n  Use when a cluster design, capacity plan, scale-up decision, GPU\u002FTPU batch\n  schedule, or a free-standing availability question needs live evidence:\n  regional quota verification (gcloud compute regions describe),\n  reservations, capacity obtainability advice (gcloud beta compute advice\n  capacity \u002F capacity-history) across zones and provisioning models, and\n  future window advice (gcloud beta compute advice calendar-mode) for \"when\n  will this shape be obtainable\". For handling an inbound cluster-autoscaler\n  stockout alert end to end — triage, GitOps remediation, Pull Request — use\n  the gke-stockout-investigator plugin skill instead.\nmetadata:\n  category: Containers\n---\n\n# GKE Capacity Obtainability\n\nQuota and capacity are different questions. Quota is a project limit you can\nraise by asking; obtainability is whether the hardware is actually free in a\nzone right now, and no amount of quota makes a stocked-out shape appear. This\nskill gathers live evidence for both, records it in a form a reviewer can\nverify, and states the distinction in the answer.\n\nIt is diagnosis and design only: nothing here creates a cluster, applies a\nmanifest, opens a Pull Request, or mutates cloud or Kubernetes state.\n\n## How to use it\n\nLoaded from a design, planning, or capacity-check request — for example the\n[gke-cluster-creation](..\u002Fgke-cluster-creation\u002FSKILL.md) preflight.\n\n### Run the checks\n\n- Run every check under **Diagnostics** below: quota, reservations, usage,\n  and capacity advice.\n- Run the capacity advice for **Spot and Flex-Start** — the two provisioning\n  models `gcloud beta compute advice capacity` accepts\n  (`--provisioning-model=SPOT` and `FLEX_START`) — and read the per-zone\n  signals from each response. **On-Demand has no advance obtainability\n  signal**: assess it through quota headroom and reservations, and say so.\n  Your final answer must weigh all three paths — On-Demand, Spot, and\n  Flex-Start — with their trade-offs.\n- Report quota and live obtainability **separately**, and include this\n  sentence verbatim in your final report: \"Quota is separate from live\n  capacity.\" Quota is a project limit; it does not prove hardware is\n  obtainable, and obtainability evidence does not raise quota. **Never use\n  the word \"guarantee\" about capacity, allocations, or scheduling anywhere\n  in the report** — not even for reservations or ProvisioningRequests;\n  write \"reserves\", \"holds\", or \"provides once scheduled\" instead.\n\n### Record what you executed as typed evidence\n\nUse the `record_evidence` tool — one record per check, built from the real\ncommand output, never from memory. **\"Design-only\", \"planning-only\", and\n\"text output only\" in a task never waive these records**: those\nconstraints forbid mutations — applying, submitting, creating — and the\ntyped records are not mutations, they are how the work is delivered. A\ntask that asks for the answer \"as text\" still gets its `record_evidence`\ncall per check and its `attach_artifact` call per manifest, alongside the\nprose; skipping them delivers a claim, not evidence. If `record_evidence`\nor `attach_artifact` is not among your tools, do not stop and do not skip\nthe check: put the same\nJSON under an `## Evidence` heading in your report, and the manifests as\nfenced YAML there, so the record still reaches the reader.\n\n- after the quota check: `type: quota_check` with `request` naming the\n  `region` and the quota `metric` you read (the recorder refuses a completed\n  record whose request lacks the region), and the limit, usage, whether the\n  request fits, and the reservations found, in `analysis` — this record is\n  the On-Demand assessment;\n- after the capacity advice calls: `type: advice_service_capacity` with\n  `apiMethod: compute.beta.AdviceService.Capacity`, shaped exactly as below.\n\nFor `advice_service_capacity`, use **exactly** these key names and shapes for\n`request` and `analysis` — do not rename keys, do not replace object entries\nwith bare strings, fill the values from the real responses. **Cover at least\ntwo zones**: a region-level call with `ANY` reports its single best zone, so\nwhen it returns fewer than two, run the per-zone follow-up in Diagnostics D\n(`--zones=\u003Czone>`) for the region's other zones and record each one — a low\nscore is still a signal and stays in `zones`; a zone the probe reports as\nunsupported goes in `analysis.zoneStatuses` (`{\"us-central1-b\":\n\"NOT_SUPPORTED\"}`). Only the two models the API returns belong in this record;\nOn-Demand is assessed from the quota and reservation checks and reported\nunder its own path below:\n\n```json\n{\n  \"request\": {\n    \"region\": \"us-central1\",\n    \"acceleratorType\": \"nvidia-a100\",\n    \"acceleratorCount\": 32\n  },\n  \"analysis\": {\n    \"availableQuantity\": 32,\n    \"zones\": [\n      { \"zone\": \"us-central1-f\", \"obtainability\": 0.9 },\n      { \"zone\": \"us-central1-a\", \"obtainability\": 0.5 }\n    ],\n    \"provisioningModels\": {\n      \"SPOT\": { \"obtainability\": 0.9, \"zone\": \"us-central1-f\" },\n      \"FLEX_START\": { \"status\": \"probed\", \"notes\": \"...\" }\n    }\n  }\n}\n```\n\n### Attach generated manifests as structured artifacts\n\nUse the `attach_artifact` tool — the parsed object, not YAML text:\n`type: computeclass` for a ComputeClass, `type: node_auto_provisioning` for a\nNAP specification; use one shared `pairId` for a design's set.\n\n### Name all three provisioning paths in the report\n\nYour final report must carry this section, with all three paths named — a\npath you analyzed but never mentioned does not exist for the reader, and a\nprobe that failed is a finding, not a gap to leave silent:\n\n```markdown\n## Provisioning paths\n\n- **On-Demand** — \u003Cquota headroom and reservations; no advance\n  obtainability signal exists for this path>\n- **Spot** — \u003Cobtainability score and zone, and the preemption trade-off>\n- **Flex-Start** — \u003Cobtainability for the run duration, or, if the probe\n  failed, what failed and what you relied on instead>\n```\n\n### Generated manifests must use the real schemas\n\nDo not invent API versions or fields; start from these shapes and adjust\nvalues only. There is no cluster to validate against on a Day-0 design, and\nthe agent's Kubernetes grant is read-only, so the shapes below are the check:\na manifest that departs from them is a finding, not a deliverable.\n\nA GKE ComputeClass is `cloud.google.com\u002Fv1` (never `autopilot.gke.io\u002F*`),\n`machineFamily` takes a family (`a2`), not a machine type, and GPU fallback\ntiers select accelerators via `gpu.type`. The order follows the\n[gke-compute-classes](..\u002Fgke-compute-classes\u002FSKILL.md) AI\u002FML rule and Rule D\nbelow: On-Demand (or a reservation) on the requested family first, Spot on\nthe same family second, never Spot as the primary tier:\n\n```yaml\napiVersion: cloud.google.com\u002Fv1\nkind: ComputeClass\nmetadata:\n  name: \u003Cdesign>-cc\nspec:\n  priorities:\n    - machineFamily: a2 # primary: the requested family, On-Demand\n    - machineFamily: a2 # same family on Spot, behind the floor\n      spot: true\n    - gpu: # fallback tier: smaller accelerator\n        type: nvidia-l4\n        count: 1\n    - gpu: # last-resort tier\n        type: nvidia-tesla-t4\n        count: 1\n  nodePoolAutoCreation:\n    enabled: true\n```\n\nCall out explicitly that the L4\u002FT4 fallback tiers change the workload's GPU\nclass and interconnect characteristics.\n\nA Node Auto-Provisioning alternative constrains machine families through node\naffinity, and its location policy lives under `location`:\n\n```yaml\nkind: NodeAutoProvisioningSpec\nspec:\n  nodeAffinity:\n    requiredDuringSchedulingIgnoredDuringExecution:\n      nodeSelectorTerms:\n        - matchExpressions:\n            - key: cloud.google.com\u002Fmachine-family\n              operator: In\n              values: [n2, n2d, c2d]\n  location:\n    locationPolicy: ANY\n```\n\n## Future windows (batch jobs with a deadline)\n\nRun this section when the request is a job, not a cluster: a given shape and\ncount that must run for a given duration inside a horizon (\"64 TPU v5e nodes,\n12 hours, within 48 hours\"). It answers _when_ and _where_ the shape is\npredicted obtainable, with Diagnostics E below; the quota check (Diagnostics\nA) still runs first, because a window you lack quota for is not a plan.\n\nFacts the probe rests on, verified against the live API — do not guess past\nthem:\n\n- **The API counts chips, not nodes.** A v5e host carries 4 chips, so 64\n  nodes is `--chip-count=256`. State the conversion arithmetic in the\n  report body itself — \"64 nodes × 4 chips per host = 256 chips\" — and\n  record both numbers in the evidence, so a reader can check the\n  arithmetic without opening the probe.\n- **The minimum reservable window is one day.** A `--duration-range` under\n  `min=1d` returns `CONDITIONS_NOT_MET` (\"The time window is too short\") in\n  every zone. Reserve the day and run the job inside it: the job's own\n  duration goes in the report and the ProvisioningRequest\n  (`maxRunDurationSeconds`), never in the probe's duration range.\n- **One call per candidate region, one recommended window per call.** A\n  success carries `startTime`, `endTime`, and `location` for the best window\n  in that region, plus a per-zone status map (`otherLocations`) for the\n  rest: `NO_CAPACITY`, `NOT_SUPPORTED`, or `CONDITIONS_NOT_MET` with\n  details. A zone that does not support the shape is a finding to report,\n  not a retry.\n- **The deadline bounds the start.** A job of duration D with horizon H\n  cannot start later than H − D after now; pass exactly that as\n  `--start-time-range` (compute the range immediately before the call, not\n  at the start of the conversation). A 12-hour job with a 48-hour horizon\n  cannot start later than hour 36.\n\n**Ranking.** Collect every region's recommended window, then rank: earliest\nstart first; ties break toward the zone with the larger quota headroom from\nDiagnostics A. Ranks are unique and consecutive from one. The recommendation\nnames the rank-one window's zone and exact UTC start time, and lists the\nrunner-up windows and every zone that returned no window, with its status.\nIf no allowed zone returns a window, say so and report each zone's status —\nan honest \"no window inside the horizon\" is the answer, not a failure to\nhide.\n\n**Record the evidence.** One `type:\nadvice_service_workload_obtainability_planning` record per region call.\nUse **exactly** this `request` shape — do not rename keys and do not\nrestate the gcloud flags as a flat dictionary; `futureResourcesSpecs` is\nthe API's body, reconstructed from the flags you passed (the shell gate\nrefuses `--log-http`, so capturing the wire body is not a path you have).\nA v5e host carries 4 chips and the reservation floor is one day, so for 64\nnodes the aggregate is 256 chips and the durations are `86400s`:\n\n```json\n{\n  \"region\": \"europe-west4\",\n  \"nodeCount\": 64,\n  \"chipsPerNode\": 4,\n  \"futureResourcesSpecs\": {\n    \"spec\": {\n      \"deploymentType\": \"DENSE\",\n      \"locationPolicy\": {\n        \"locations\": { \"zones\u002Feurope-west4-b\": { \"preference\": \"ALLOW\" } }\n      },\n      \"targetResources\": {\n        \"aggregateResources\": {\n          \"acceleratorCount\": 256,\n          \"vmFamily\": \"VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP\",\n          \"workloadType\": \"BATCH\"\n        }\n      },\n      \"timeRangeSpec\": {\n        \"minDuration\": \"86400s\",\n        \"maxDuration\": \"86400s\",\n        \"startTimeNotEarlierThan\": \"\u003Cnow, RFC 3339 UTC>\",\n        \"startTimeNotLaterThan\": \"\u003Cnow + horizon - job duration>\"\n      }\n    }\n  }\n}\n```\n\nSet `apiMethod: compute.beta.AdviceService.CalendarMode` and put the\nstructured findings from the real response in `analysis` — copy them as\nthe response gave them: the recommended `location`, `startTime`,\n`endTime`, and `otherLocations`, or the verbatim `recommendations` list.\nA region that returns no window still gets its `otherLocations` map with\neach zone's status; never record a null or empty `analysis` — a probe\nwhose record names no zone cannot be checked and does not count. Then exactly one\n`type: workload_obtainability_planning_analysis` record whose `analysis`\ncarries two keys: `windows`, every schedulable window **in rank order,\nrank one first**, each with `region`, `zone`, `startTime`, `endTime`,\n`durationHours` (the job's, not the reservation's), `capacitySignal` (the\nzone's status or `RECOMMENDED`), and its `rank`; and `zoneStatuses`, one\nentry per allowed zone that returned no window, mapping the zone to the\nstatus the API gave (`NO_CAPACITY`, `NOT_SUPPORTED`, ...), so the analysis\ncovers every allowed zone whether or not it is obtainable.\n\n**Attach the paired manifests.** A Dynamic Workload Scheduler request and\nits Kueue queue, both under one `pairId`, both carrying a `target` of the\nrank-one window's `region`, `zone`, and `startTime`, and both in the same\nnamespace. The shapes are pinned; adjust values only:\n\n```yaml\napiVersion: autoscaling.x-k8s.io\u002Fv1\nkind: ProvisioningRequest\nmetadata:\n  name: \u003Cjob>-window\n  namespace: \u003Cnamespace>\n  annotations:\n    obtainability.kube-agents\u002Fzone: \u003Crank-one zone>\n    obtainability.kube-agents\u002Fstart: \"\u003Crank-one startTime, UTC>\"\nspec:\n  provisioningClassName: queued-provisioning.gke.io\n  parameters:\n    maxRunDurationSeconds: \"43200\" # the job's run, not the reservation day\n  podSets:\n    - count: 64 # nodes, not chips\n      podTemplateRef:\n        name: \u003Cjob>-pod-template\n```\n\n```yaml\napiVersion: kueue.x-k8s.io\u002Fv1beta1\nkind: LocalQueue\nmetadata:\n  name: \u003Cjob>-queue\n  namespace: \u003Cnamespace>\n  annotations:\n    obtainability.kube-agents\u002Fzone: \u003Crank-one zone>\nspec:\n  clusterQueue: \u003Ccluster-queue>\n```\n\nAttach each with `attach_artifact` (`type: provisioning_request`,\n`type: local_queue`) as parsed objects with `machineSpec` (for a TPU job,\n`acceleratorType: tpu-v5e` and the chip arithmetic), `pairId`, and\n`target`. Planning only: hand both manifests to the user, apply nothing,\nsubmit nothing.\n\n**Anchor the probe at the clock, not at a buffer.** The range's `from` is\nnow — the moment you run the command — not now plus a safety margin; the\nAPI's own window search supplies any slack.\n\n**Report.** Carry this section, filled in:\n\n```markdown\n## Future windows\n\n- **Recommended**: \u003Czone> starting \u003CUTC time> — \u003Cone line on why it ranked\n  first>\n- **Runners-up**: \u003Czone and start per window, or \"none\">\n- **No window**: \u003Czone: status and detail, one line each, or \"none\">\n- The job must start by \u003CUTC time> to finish inside the horizon.\n```\n\n**Unattended runs.** A session with no person in it — a scheduled re-check,\nan event-triggered run — asks no clarifying questions: take the missing\nvalues from the original request being re-checked or from the capability's\nrecorded defaults, list every assumption in the report, and propose rather\nthan apply any change to how the check runs.\n\n## Diagnostics\n\n#### A. Quota Verification\n\nVerify that the proposed machine families, CPU, or GPU metric counts are within the region's quota limits:\n\n```bash\ngcloud compute regions describe us-central1 --format=\"json(quotas.filter(metric=CPUS))\"\ngcloud compute regions describe us-central1 --format=\"json(quotas.filter(metric=NVIDIA_L4_GPUS))\"\n```\n\n_Note: Filter by other metric names (e.g., `N4_CPUS`, `C4_CPUS`, `NVIDIA_T4_GPUS`, `NVIDIA_A100_GPUS`) to inspect specific hardware._\n\n#### B. Reservations Check\n\nCheck if any zonal reservations are available for the target workload's machine type; a reservation holds capacity for it (the report must not describe this as a guarantee):\n\n```bash\ngcloud compute reservations list --format=\"json\"\n```\n\n#### C. Actual Workload Resource Usage\n\nBefore proposing resource reservations or changing VM shapes, analyze actual usage and account for potential spikes. Use:\n\n```bash\n# Get node CPU\u002Fmemory utilization summary\nkubectl top node\n\n# Fetch raw metrics from the metrics API server\nkubectl get --raw \"\u002Fapis\u002Fmetrics.k8s.io\u002Fv1beta1\u002Fnodes\"\n\n# Get pod CPU\u002Fmemory utilization summary\nkubectl top pod -n \u003Cnamespace>\n```\n\n#### D. Spot VM Availability and Pricing Advice\n\nIf configuring fallback Spot instances or diagnosing GPU stockouts, use the Spot advice APIs to check obtainability and preemption risk across target zones.\n\n**VM & GPU Availability Advice**:\n\n```bash\ngcloud beta compute advice capacity \\\n    --provisioning-model=SPOT \\\n    --instance-selection-machine-types=\"g2-standard-4,g2-standard-12,n1-standard-4\" \\\n    --target-distribution-shape=ANY \\\n    --size=1 \\\n    --region=us-central1 \\\n    --format=\"json\"\n```\n\n**Per-zone follow-up** (when the region-level call above returns fewer than\ntwo zones — `ANY` reports the single best one, and a design needs the\nsideways look; run once per remaining zone of the region that supports the\nfamily):\n\n```bash\ngcloud beta compute advice capacity \\\n    --provisioning-model=SPOT \\\n    --instance-selection-machine-types=\"a2-highgpu-8g\" \\\n    --target-distribution-shape=ANY \\\n    --size=4 \\\n    --region=us-central1 \\\n    --zones=us-central1-a \\\n    --format=\"json\"\n```\n\n**Flex-Start Availability Advice** (the same probe with\n`--provisioning-model=FLEX_START` and the job's run duration):\n\n```bash\ngcloud beta compute advice capacity \\\n    --provisioning-model=FLEX_START \\\n    --instance-selection-machine-types=\"a2-highgpu-8g\" \\\n    --target-distribution-shape=ANY \\\n    --size=4 \\\n    --region=us-central1 \\\n    --max-run-duration=12h \\\n    --format=\"json\"\n```\n\n**Preemption Rate and Price History**:\n\n```bash\ngcloud beta compute advice capacity-history \\\n    --provisioning-model=SPOT \\\n    --machine-type=g2-standard-4 \\\n    --types=PREEMPTION,PRICE \\\n    --region=us-central1 \\\n    --format=\"json\"\n```\n\n#### E. Future Reservation Calendar Advice\n\nFor a deadline-bound batch job (the **Future windows** section above), probe\neach candidate region for its best predicted window. TPU shapes take a\nversion, chip count, and workload type; VM shapes take a machine type and VM\ncount (plus `--local-ssd` where the shape has one):\n\n```bash\nFROM=\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"              # now, this probe's clock\nTO=\"$(date -u -d '+36 hours' +%Y-%m-%dT%H:%M:%SZ)\" # horizon minus job duration\ngcloud beta compute advice calendar-mode \\\n    --region=us-central1 \\\n    --tpu-version=V5E --chip-count=256 --workload-type=BATCH \\\n    --duration-range=min=1d,max=1d \\\n    --start-time-range=from=\"$FROM\",to=\"$TO\" \\\n    --location-policy=us-central1-a=ALLOW \\\n    --format=json\n```\n\nCompute both ends of `--start-time-range` from the clock at probe time, as\nRFC 3339 UTC (`date -u +%Y-%m-%dT%H:%M:%SZ`) — never reuse a timestamp\nfrom an example or an earlier turn; a window that starts in the past\ncannot be reserved. `--location-policy`\nnarrows to the zones the user allowed, and is omitted to consider every\nzone in the region.\n\n_MANDATE_: You MUST actually execute the quota check (`gcloud compute regions\ndescribe`), the capacity advice (`gcloud beta compute advice capacity`), and,\nwhere preemption history matters, `gcloud beta compute advice capacity-history`\n— for a deadline-bound batch job, `gcloud beta compute advice calendar-mode`\nper candidate region — then record each as typed evidence and list the exact\ncommands you ran in your report. An analysis you did not execute is not\nevidence.\n\n## ComputeClass resilience rules\n\nThese are the failure modes a fallback design has to survive. Check a design\nyou are proposing — or an existing ComputeClass you are reviewing — against\neach of them.\n\n#### Rule A: Lack of Zone\u002FFamily Fallbacks\n\n- **Problem**: The ComputeClass `priorities[]` is pinned to a single machine family or a single zone, leaving no alternative when GCE encounters a stockout.\n- **Fix**: Propose adding fallback priorities (additional machine families like `n4`, `c4`, `n2` or other zones within the region).\n\n#### Rule B: Large VM Shape Scarcity (>32 vCPUs)\n\n- **Problem**: The workload requests very large VMs (>32 vCPU) which draw from thinner capacity pools and are highly prone to stockouts.\n- **Fix**:\n  - If the workload is horizontally-scalable (e.g., stateless app with multiple replicas, batch job), propose updating the workload manifest to use smaller replicas (e.g., ≤32 vCPUs) and adding smaller-core fallback priorities to the ComputeClass.\n  - If the workload is NOT horizontally-scalable (e.g., a single large monolithic database or inference server), do NOT shrink the shape. Instead, vary the machine family (e.g., fallback from C3 to N2\u002FN4) and zones.\n\n#### Rule C: Stateful Disk Generation Mix\n\n- **Problem**: For stateful workloads using Persistent Volumes (PVs), Gen 2 VMs (e.g., `n2`, `n2d`) and Gen 4 VMs (e.g., `c4`, `n4` with Hyperdisk) are mixed in the same `priorities[]` array, causing PV attachment deadlocks.\n- **Fix**: Remove the mixed generations. The priority list for a PV-attached workload must stick to all Gen 2 or all Gen 4 machine families.\n\n#### Rule D: Missing On-Demand Floor\n\n- **Problem**: The priority list contains only Spot instances without an On-Demand floor. If Spot is exhausted, the workload stays `Pending`.\n- **Fix**: Add a lower-priority On-Demand priority rule at the end of the `priorities[]` array to act as a safety floor.\n\n#### Rule E: Regional Scarcity (Specialized Hardware, e.g., GPUs\u002FTPUs)\n\n- **Problem**: The requested specialized hardware (e.g., Nvidia H100, L4, or TPU v5e) is completely stocked out across all zones in the target region.\n- **Fix**: Recommend migrating the workload and its infrastructure to another GCP region where capacity is available, or changing the application architecture to use a more available hardware class.\n\n#### Rule F: Regional Quota Exceeded Violation (`quota exceeded` \u002F GPU Limit Cap)\n\n- **Problem**: A workload requests more total resources (CPUs or GPUs) than the regional quota limit configured for the project in that region (e.g., requesting 32 L4 GPUs when `gcloud compute regions describe us-central1` shows the `NVIDIA_L4_GPUS` quota limit is 24).\n- **Fix**: Identify this explicitly as a **Regional Quota Exceeded Violation** in the diagnosis. Propose adjusting the workload deployment manifest to cap total requested GPUs\u002FCPUs to fit strictly within the regional quota limit (e.g. reducing replicas from 4 to 3 so total GPUs = 24), and create a `ComputeClass` providing multi-zone fallback capabilities.\n\n#### Rule G: CCC Priority Starvation & Reset Loop (Excessive Granular Machine Types)\n\n> [!IMPORTANT]\n> **MANDATORY PRIORITY CHECK**: If a ComputeClass `priorities[]` list contains more than 10 granular `machineType` rules (e.g., 25 priority rules for specific machine shapes like `n2-standard-4`, `n2-standard-8`, etc.), this is a Rule G violation. You MUST NOT add more `machineType` rules. Instead, you MUST auto-compress the configuration by replacing ALL 25 granular `machineType` rules with 4 family-level (`machineFamily`) rules (e.g., `n4`, `c3`, `n2`, `e2`).\n\n- **Problem**: A Custom Compute Class (CCC) contains excessive granular `machineType` rules (e.g., 25 priority rules for specific machine shapes), exceeding Flex Advisor's cache limit (generating >200 combinations) and triggering a Cluster Autoscaler backoff reset loop. Lower-priority fallbacks (`n2`, `e2`) are starved and pods remain stuck in `Pending`.\n- **Fix**: Auto-compress the CCC configuration: Completely REPLACE the entire list of specific granular machine sizes (`machineType`) with 4 family-level definitions (`machineFamily`: `n4`, `c3`, `n2`, `e2`), reducing priority rules from 25 to 4 family-level priorities and avoiding the starvation loop.\n\n#### Rule H: Hyperdisk Incompatibility with Older Generation Machines\n\n- **Problem**: A workload using Hyperdisk (e.g. `hyperdisk-balanced`, `hyperdisk-throughput`, `hyperdisk-extreme`, or StorageClass with hyperdisk CSI provisioner) uses a CCC definition whose 1st choice is a 3rd\u002F4th generation machine type (e.g. `c3-standard-4`, `c4-standard-4`), but has fallbacks to older generation machine types (e.g. `c2`, `n2`, `e2`). Once there is a stockout on the 1st choice, Cluster Autoscaler falls back to an incompatible machine type (`c2`, `n2`, `e2`) that does not support Hyperdisk, causing scale-up to fail.\n- **Fix**: Increase CCC fallback options to other machine families compatible with Hyperdisk (e.g. `c3`, `c4`, `n4`, `c3d`), and remove fallbacks which do not work with Hyperdisk (`c2`, `n2`, `e2`).\n","# GKE Capacity Obtainability\n\nQuota and capacity are different questions. Quota is a project limit you can\nraise by asking; obtainability is whether the hardware is actually free in a\nzone right now, and no amount of quota makes a stocked-out shape appear. This\nskill gathers live evidence for both, records it in a form a reviewer can\nverify, and states the distinction in the answer.\n\nIt is diagnosis and design only: nothing here creates a cluster, applies a\nmanifest, opens a Pull Request, or mutates cloud or Kubernetes state.\n\n## How to use it\n\nLoaded from a design, planning, or capacity-check request — for example the\n[gke-cluster-creation](..\u002Fgke-cluster-creation\u002FSKILL.md) preflight.\n\n### Run the checks\n\n- Run every check under **Diagnostics** below: quota, reservations, usage,\n  and capacity advice.\n- Run the capacity advice for **Spot and Flex-Start** — the two provisioning\n  models `gcloud beta compute advice capacity` accepts\n  (`--provisioning-model=SPOT` and `FLEX_START`) — and read the per-zone\n  signals from each response. **On-Demand has no advance obtainability\n  signal**: assess it through quota headroom and reservations, and say so.\n  Your final answer must weigh all three paths — On-Demand, Spot, and\n  Flex-Start — with their trade-offs.\n- Report quota and live obtainability **separately**, and include this\n  sentence verbatim in your final report: \"Quota is separate from live\n  capacity.\" Quota is a project limit; it does not prove hardware is\n  obtainable, and obtainability evidence does not raise quota. **Never use\n  the word \"guarantee\" about capacity, allocations, or scheduling anywhere\n  in the report** — not even for reservations or ProvisioningRequests;\n  write \"reserves\", \"holds\", or \"provides once scheduled\" instead.\n\n### Record what you executed as typed evidence\n\nUse the `record_evidence` tool — one record per check, built from the real\ncommand output, never from memory. **\"Design-only\", \"planning-only\", and\n\"text output only\" in a task never waive these records**: those\nconstraints forbid mutations — applying, submitting, creating — and the\ntyped records are not mutations, they are how the work is delivered. A\ntask that asks for the answer \"as text\" still gets its `record_evidence`\ncall per check and its `attach_artifact` call per manifest, alongside the\nprose; skipping them delivers a claim, not evidence. If `record_evidence`\nor `attach_artifact` is not among your tools, do not stop and do not skip\nthe check: put the same\nJSON under an `## Evidence` heading in your report, and the manifests as\nfenced YAML there, so the record still reaches the reader.\n\n- after the quota check: `type: quota_check` with `request` naming the\n  `region` and the quota `metric` you read (the recorder refuses a completed\n  record whose request lacks the region), and the limit, usage, whether the\n  request fits, and the reservations found, in `analysis` — this record is\n  the On-Demand assessment;\n- after the capacity advice calls: `type: advice_service_capacity` with\n  `apiMethod: compute.beta.AdviceService.Capacity`, shaped exactly as below.\n\nFor `advice_service_capacity`, use **exactly** these key names and shapes for\n`request` and `analysis` — do not rename keys, do not replace object entries\nwith bare strings, fill the values from the real responses. **Cover at least\ntwo zones**: a region-level call with `ANY` reports its single best zone, so\nwhen it returns fewer than two, run the per-zone follow-up in Diagnostics D\n(`--zones=\u003Czone>`) for the region's other zones and record each one — a low\nscore is still a signal and stays in `zones`; a zone the probe reports as\nunsupported goes in `analysis.zoneStatuses` (`{\"us-central1-b\":\n\"NOT_SUPPORTED\"}`). Only the two models the API returns belong in this record;\nOn-Demand is assessed from the quota and reservation checks and reported\nunder its own path below:\n\n```json\n{\n  \"request\": {\n    \"region\": \"us-central1\",\n    \"acceleratorType\": \"nvidia-a100\",\n    \"acceleratorCount\": 32\n  },\n  \"analysis\": {\n    \"availableQuantity\": 32,\n    \"zones\": [\n      { \"zone\": \"us-central1-f\", \"obtainability\": 0.9 },\n      { \"zone\": \"us-central1-a\", \"obtainability\": 0.5 }\n    ],\n    \"provisioningModels\": {\n      \"SPOT\": { \"obtainability\": 0.9, \"zone\": \"us-central1-f\" },\n      \"FLEX_START\": { \"status\": \"probed\", \"notes\": \"...\" }\n    }\n  }\n}\n```\n\n### Attach generated manifests as structured artifacts\n\nUse the `attach_artifact` tool — the parsed object, not YAML text:\n`type: computeclass` for a ComputeClass, `type: node_auto_provisioning` for a\nNAP specification; use one shared `pairId` for a design's set.\n\n### Name all three provisioning paths in the report\n\nYour final report must carry this section, with all three paths named — a\npath you analyzed but never mentioned does not exist for the reader, and a\nprobe that failed is a finding, not a gap to leave silent:\n\n```markdown\n## Provisioning paths\n\n- **On-Demand** — \u003Cquota headroom and reservations; no advance\n  obtainability signal exists for this path>\n- **Spot** — \u003Cobtainability score and zone, and the preemption trade-off>\n- **Flex-Start** — \u003Cobtainability for the run duration, or, if the probe\n  failed, what failed and what you relied on instead>\n```\n\n### Generated manifests must use the real schemas\n\nDo not invent API versions or fields; start from these shapes and adjust\nvalues only. There is no cluster to validate against on a Day-0 design, and\nthe agent's Kubernetes grant is read-only, so the shapes below are the check:\na manifest that departs from them is a finding, not a deliverable.\n\nA GKE ComputeClass is `cloud.google.com\u002Fv1` (never `autopilot.gke.io\u002F*`),\n`machineFamily` takes a family (`a2`), not a machine type, and GPU fallback\ntiers select accelerators via `gpu.type`. The order follows the\n[gke-compute-classes](..\u002Fgke-compute-classes\u002FSKILL.md) AI\u002FML rule and Rule D\nbelow: On-Demand (or a reservation) on the requested family first, Spot on\nthe same family second, never Spot as the primary tier:\n\n```yaml\napiVersion: cloud.google.com\u002Fv1\nkind: ComputeClass\nmetadata:\n  name: \u003Cdesign>-cc\nspec:\n  priorities:\n    - machineFamily: a2 # primary: the requested family, On-Demand\n    - machineFamily: a2 # same family on Spot, behind the floor\n      spot: true\n    - gpu: # fallback tier: smaller accelerator\n        type: nvidia-l4\n        count: 1\n    - gpu: # last-resort tier\n        type: nvidia-tesla-t4\n        count: 1\n  nodePoolAutoCreation:\n    enabled: true\n```\n\nCall out explicitly that the L4\u002FT4 fallback tiers change the workload's GPU\nclass and interconnect characteristics.\n\nA Node Auto-Provisioning alternative constrains machine families through node\naffinity, and its location policy lives under `location`:\n\n```yaml\nkind: NodeAutoProvisioningSpec\nspec:\n  nodeAffinity:\n    requiredDuringSchedulingIgnoredDuringExecution:\n      nodeSelectorTerms:\n        - matchExpressions:\n            - key: cloud.google.com\u002Fmachine-family\n              operator: In\n              values: [n2, n2d, c2d]\n  location:\n    locationPolicy: ANY\n```\n\n## Future windows (batch jobs with a deadline)\n\nRun this section when the request is a job, not a cluster: a given shape and\ncount that must run for a given duration inside a horizon (\"64 TPU v5e nodes,\n12 hours, within 48 hours\"). It answers _when_ and _where_ the shape is\npredicted obtainable, with Diagnostics E below; the quota check (Diagnostics\nA) still runs first, because a window you lack quota for is not a plan.\n\nFacts the probe rests on, verified against the live API — do not guess past\nthem:\n\n- **The API counts chips, not nodes.** A v5e host carries 4 chips, so 64\n  nodes is `--chip-count=256`. State the conversion arithmetic in the\n  report body itself — \"64 nodes × 4 chips per host = 256 chips\" — and\n  record both numbers in the evidence, so a reader can check the\n  arithmetic without opening the probe.\n- **The minimum reservable window is one day.** A `--duration-range` under\n  `min=1d` returns `CONDITIONS_NOT_MET` (\"The time window is too short\") in\n  every zone. Reserve the day and run the job inside it: the job's own\n  duration goes in the report and the ProvisioningRequest\n  (`maxRunDurationSeconds`), never in the probe's duration range.\n- **One call per candidate region, one recommended window per call.** A\n  success carries `startTime`, `endTime`, and `location` for the best window\n  in that region, plus a per-zone status map (`otherLocations`) for the\n  rest: `NO_CAPACITY`, `NOT_SUPPORTED`, or `CONDITIONS_NOT_MET` with\n  details. A zone that does not support the shape is a finding to report,\n  not a retry.\n- **The deadline bounds the start.** A job of duration D with horizon H\n  cannot start later than H − D after now; pass exactly that as\n  `--start-time-range` (compute the range immediately before the call, not\n  at the start of the conversation). A 12-hour job with a 48-hour horizon\n  cannot start later than hour 36.\n\n**Ranking.** Collect every region's recommended window, then rank: earliest\nstart first; ties break toward the zone with the larger quota headroom from\nDiagnostics A. Ranks are unique and consecutive from one. The recommendation\nnames the rank-one window's zone and exact UTC start time, and lists the\nrunner-up windows and every zone that returned no window, with its status.\nIf no allowed zone returns a window, say so and report each zone's status —\nan honest \"no window inside the horizon\" is the answer, not a failure to\nhide.\n\n**Record the evidence.** One `type:\nadvice_service_workload_obtainability_planning` record per region call.\nUse **exactly** this `request` shape — do not rename keys and do not\nrestate the gcloud flags as a flat dictionary; `futureResourcesSpecs` is\nthe API's body, reconstructed from the flags you passed (the shell gate\nrefuses `--log-http`, so capturing the wire body is not a path you have).\nA v5e host carries 4 chips and the reservation floor is one day, so for 64\nnodes the aggregate is 256 chips and the durations are `86400s`:\n\n```json\n{\n  \"region\": \"europe-west4\",\n  \"nodeCount\": 64,\n  \"chipsPerNode\": 4,\n  \"futureResourcesSpecs\": {\n    \"spec\": {\n      \"deploymentType\": \"DENSE\",\n      \"locationPolicy\": {\n        \"locations\": { \"zones\u002Feurope-west4-b\": { \"preference\": \"ALLOW\" } }\n      },\n      \"targetResources\": {\n        \"aggregateResources\": {\n          \"acceleratorCount\": 256,\n          \"vmFamily\": \"VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP\",\n          \"workloadType\": \"BATCH\"\n        }\n      },\n      \"timeRangeSpec\": {\n        \"minDuration\": \"86400s\",\n        \"maxDuration\": \"86400s\",\n        \"startTimeNotEarlierThan\": \"\u003Cnow, RFC 3339 UTC>\",\n        \"startTimeNotLaterThan\": \"\u003Cnow + horizon - job duration>\"\n      }\n    }\n  }\n}\n```\n\nSet `apiMethod: compute.beta.AdviceService.CalendarMode` and put the\nstructured findings from the real response in `analysis` — copy them as\nthe response gave them: the recommended `location`, `startTime`,\n`endTime`, and `otherLocations`, or the verbatim `recommendations` list.\nA region that returns no window still gets its `otherLocations` map with\neach zone's status; never record a null or empty `analysis` — a probe\nwhose record names no zone cannot be checked and does not count. Then exactly one\n`type: workload_obtainability_planning_analysis` record whose `analysis`\ncarries two keys: `windows`, every schedulable window **in rank order,\nrank one first**, each with `region`, `zone`, `startTime`, `endTime`,\n`durationHours` (the job's, not the reservation's), `capacitySignal` (the\nzone's status or `RECOMMENDED`), and its `rank`; and `zoneStatuses`, one\nentry per allowed zone that returned no window, mapping the zone to the\nstatus the API gave (`NO_CAPACITY`, `NOT_SUPPORTED`, ...), so the analysis\ncovers every allowed zone whether or not it is obtainable.\n\n**Attach the paired manifests.** A Dynamic Workload Scheduler request and\nits Kueue queue, both under one `pairId`, both carrying a `target` of the\nrank-one window's `region`, `zone`, and `startTime`, and both in the same\nnamespace. The shapes are pinned; adjust values only:\n\n```yaml\napiVersion: autoscaling.x-k8s.io\u002Fv1\nkind: ProvisioningRequest\nmetadata:\n  name: \u003Cjob>-window\n  namespace: \u003Cnamespace>\n  annotations:\n    obtainability.kube-agents\u002Fzone: \u003Crank-one zone>\n    obtainability.kube-agents\u002Fstart: \"\u003Crank-one startTime, UTC>\"\nspec:\n  provisioningClassName: queued-provisioning.gke.io\n  parameters:\n    maxRunDurationSeconds: \"43200\" # the job's run, not the reservation day\n  podSets:\n    - count: 64 # nodes, not chips\n      podTemplateRef:\n        name: \u003Cjob>-pod-template\n```\n\n```yaml\napiVersion: kueue.x-k8s.io\u002Fv1beta1\nkind: LocalQueue\nmetadata:\n  name: \u003Cjob>-queue\n  namespace: \u003Cnamespace>\n  annotations:\n    obtainability.kube-agents\u002Fzone: \u003Crank-one zone>\nspec:\n  clusterQueue: \u003Ccluster-queue>\n```\n\nAttach each with `attach_artifact` (`type: provisioning_request`,\n`type: local_queue`) as parsed objects with `machineSpec` (for a TPU job,\n`acceleratorType: tpu-v5e` and the chip arithmetic), `pairId`, and\n`target`. Planning only: hand both manifests to the user, apply nothing,\nsubmit nothing.\n\n**Anchor the probe at the clock, not at a buffer.** The range's `from` is\nnow — the moment you run the command — not now plus a safety margin; the\nAPI's own window search supplies any slack.\n\n**Report.** Carry this section, filled in:\n\n```markdown\n## Future windows\n\n- **Recommended**: \u003Czone> starting \u003CUTC time> — \u003Cone line on why it ranked\n  first>\n- **Runners-up**: \u003Czone and start per window, or \"none\">\n- **No window**: \u003Czone: status and detail, one line each, or \"none\">\n- The job must start by \u003CUTC time> to finish inside the horizon.\n```\n\n**Unattended runs.** A session with no person in it — a scheduled re-check,\nan event-triggered run — asks no clarifying questions: take the missing\nvalues from the original request being re-checked or from the capability's\nrecorded defaults, list every assumption in the report, and propose rather\nthan apply any change to how the check runs.\n\n## Diagnostics\n\n#### A. Quota Verification\n\nVerify that the proposed machine families, CPU, or GPU metric counts are within the region's quota limits:\n\n```bash\ngcloud compute regions describe us-central1 --format=\"json(quotas.filter(metric=CPUS))\"\ngcloud compute regions describe us-central1 --format=\"json(quotas.filter(metric=NVIDIA_L4_GPUS))\"\n```\n\n_Note: Filter by other metric names (e.g., `N4_CPUS`, `C4_CPUS`, `NVIDIA_T4_GPUS`, `NVIDIA_A100_GPUS`) to inspect specific hardware._\n\n#### B. Reservations Check\n\nCheck if any zonal reservations are available for the target workload's machine type; a reservation holds capacity for it (the report must not describe this as a guarantee):\n\n```bash\ngcloud compute reservations list --format=\"json\"\n```\n\n#### C. Actual Workload Resource Usage\n\nBefore proposing resource reservations or changing VM shapes, analyze actual usage and account for potential spikes. Use:\n\n```bash\n# Get node CPU\u002Fmemory utilization summary\nkubectl top node\n\n# Fetch raw metrics from the metrics API server\nkubectl get --raw \"\u002Fapis\u002Fmetrics.k8s.io\u002Fv1beta1\u002Fnodes\"\n\n# Get pod CPU\u002Fmemory utilization summary\nkubectl top pod -n \u003Cnamespace>\n```\n\n#### D. Spot VM Availability and Pricing Advice\n\nIf configuring fallback Spot instances or diagnosing GPU stockouts, use the Spot advice APIs to check obtainability and preemption risk across target zones.\n\n**VM & GPU Availability Advice**:\n\n```bash\ngcloud beta compute advice capacity \\\n    --provisioning-model=SPOT \\\n    --instance-selection-machine-types=\"g2-standard-4,g2-standard-12,n1-standard-4\" \\\n    --target-distribution-shape=ANY \\\n    --size=1 \\\n    --region=us-central1 \\\n    --format=\"json\"\n```\n\n**Per-zone follow-up** (when the region-level call above returns fewer than\ntwo zones — `ANY` reports the single best one, and a design needs the\nsideways look; run once per remaining zone of the region that supports the\nfamily):\n\n```bash\ngcloud beta compute advice capacity \\\n    --provisioning-model=SPOT \\\n    --instance-selection-machine-types=\"a2-highgpu-8g\" \\\n    --target-distribution-shape=ANY \\\n    --size=4 \\\n    --region=us-central1 \\\n    --zones=us-central1-a \\\n    --format=\"json\"\n```\n\n**Flex-Start Availability Advice** (the same probe with\n`--provisioning-model=FLEX_START` and the job's run duration):\n\n```bash\ngcloud beta compute advice capacity \\\n    --provisioning-model=FLEX_START \\\n    --instance-selection-machine-types=\"a2-highgpu-8g\" \\\n    --target-distribution-shape=ANY \\\n    --size=4 \\\n    --region=us-central1 \\\n    --max-run-duration=12h \\\n    --format=\"json\"\n```\n\n**Preemption Rate and Price History**:\n\n```bash\ngcloud beta compute advice capacity-history \\\n    --provisioning-model=SPOT \\\n    --machine-type=g2-standard-4 \\\n    --types=PREEMPTION,PRICE \\\n    --region=us-central1 \\\n    --format=\"json\"\n```\n\n#### E. Future Reservation Calendar Advice\n\nFor a deadline-bound batch job (the **Future windows** section above), probe\neach candidate region for its best predicted window. TPU shapes take a\nversion, chip count, and workload type; VM shapes take a machine type and VM\ncount (plus `--local-ssd` where the shape has one):\n\n```bash\nFROM=\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"              # now, this probe's clock\nTO=\"$(date -u -d '+36 hours' +%Y-%m-%dT%H:%M:%SZ)\" # horizon minus job duration\ngcloud beta compute advice calendar-mode \\\n    --region=us-central1 \\\n    --tpu-version=V5E --chip-count=256 --workload-type=BATCH \\\n    --duration-range=min=1d,max=1d \\\n    --start-time-range=from=\"$FROM\",to=\"$TO\" \\\n    --location-policy=us-central1-a=ALLOW \\\n    --format=json\n```\n\nCompute both ends of `--start-time-range` from the clock at probe time, as\nRFC 3339 UTC (`date -u +%Y-%m-%dT%H:%M:%SZ`) — never reuse a timestamp\nfrom an example or an earlier turn; a window that starts in the past\ncannot be reserved. `--location-policy`\nnarrows to the zones the user allowed, and is omitted to consider every\nzone in the region.\n\n_MANDATE_: You MUST actually execute the quota check (`gcloud compute regions\ndescribe`), the capacity advice (`gcloud beta compute advice capacity`), and,\nwhere preemption history matters, `gcloud beta compute advice capacity-history`\n— for a deadline-bound batch job, `gcloud beta compute advice calendar-mode`\nper candidate region — then record each as typed evidence and list the exact\ncommands you ran in your report. An analysis you did not execute is not\nevidence.\n\n## ComputeClass resilience rules\n\nThese are the failure modes a fallback design has to survive. Check a design\nyou are proposing — or an existing ComputeClass you are reviewing — against\neach of them.\n\n#### Rule A: Lack of Zone\u002FFamily Fallbacks\n\n- **Problem**: The ComputeClass `priorities[]` is pinned to a single machine family or a single zone, leaving no alternative when GCE encounters a stockout.\n- **Fix**: Propose adding fallback priorities (additional machine families like `n4`, `c4`, `n2` or other zones within the region).\n\n#### Rule B: Large VM Shape Scarcity (>32 vCPUs)\n\n- **Problem**: The workload requests very large VMs (>32 vCPU) which draw from thinner capacity pools and are highly prone to stockouts.\n- **Fix**:\n  - If the workload is horizontally-scalable (e.g., stateless app with multiple replicas, batch job), propose updating the workload manifest to use smaller replicas (e.g., ≤32 vCPUs) and adding smaller-core fallback priorities to the ComputeClass.\n  - If the workload is NOT horizontally-scalable (e.g., a single large monolithic database or inference server), do NOT shrink the shape. Instead, vary the machine family (e.g., fallback from C3 to N2\u002FN4) and zones.\n\n#### Rule C: Stateful Disk Generation Mix\n\n- **Problem**: For stateful workloads using Persistent Volumes (PVs), Gen 2 VMs (e.g., `n2`, `n2d`) and Gen 4 VMs (e.g., `c4`, `n4` with Hyperdisk) are mixed in the same `priorities[]` array, causing PV attachment deadlocks.\n- **Fix**: Remove the mixed generations. The priority list for a PV-attached workload must stick to all Gen 2 or all Gen 4 machine families.\n\n#### Rule D: Missing On-Demand Floor\n\n- **Problem**: The priority list contains only Spot instances without an On-Demand floor. If Spot is exhausted, the workload stays `Pending`.\n- **Fix**: Add a lower-priority On-Demand priority rule at the end of the `priorities[]` array to act as a safety floor.\n\n#### Rule E: Regional Scarcity (Specialized Hardware, e.g., GPUs\u002FTPUs)\n\n- **Problem**: The requested specialized hardware (e.g., Nvidia H100, L4, or TPU v5e) is completely stocked out across all zones in the target region.\n- **Fix**: Recommend migrating the workload and its infrastructure to another GCP region where capacity is available, or changing the application architecture to use a more available hardware class.\n\n#### Rule F: Regional Quota Exceeded Violation (`quota exceeded` \u002F GPU Limit Cap)\n\n- **Problem**: A workload requests more total resources (CPUs or GPUs) than the regional quota limit configured for the project in that region (e.g., requesting 32 L4 GPUs when `gcloud compute regions describe us-central1` shows the `NVIDIA_L4_GPUS` quota limit is 24).\n- **Fix**: Identify this explicitly as a **Regional Quota Exceeded Violation** in the diagnosis. Propose adjusting the workload deployment manifest to cap total requested GPUs\u002FCPUs to fit strictly within the regional quota limit (e.g. reducing replicas from 4 to 3 so total GPUs = 24), and create a `ComputeClass` providing multi-zone fallback capabilities.\n\n#### Rule G: CCC Priority Starvation & Reset Loop (Excessive Granular Machine Types)\n\n> [!IMPORTANT]\n> **MANDATORY PRIORITY CHECK**: If a ComputeClass `priorities[]` list contains more than 10 granular `machineType` rules (e.g., 25 priority rules for specific machine shapes like `n2-standard-4`, `n2-standard-8`, etc.), this is a Rule G violation. You MUST NOT add more `machineType` rules. Instead, you MUST auto-compress the configuration by replacing ALL 25 granular `machineType` rules with 4 family-level (`machineFamily`) rules (e.g., `n4`, `c3`, `n2`, `e2`).\n\n- **Problem**: A Custom Compute Class (CCC) contains excessive granular `machineType` rules (e.g., 25 priority rules for specific machine shapes), exceeding Flex Advisor's cache limit (generating >200 combinations) and triggering a Cluster Autoscaler backoff reset loop. Lower-priority fallbacks (`n2`, `e2`) are starved and pods remain stuck in `Pending`.\n- **Fix**: Auto-compress the CCC configuration: Completely REPLACE the entire list of specific granular machine sizes (`machineType`) with 4 family-level definitions (`machineFamily`: `n4`, `c3`, `n2`, `e2`), reducing priority rules from 25 to 4 family-level priorities and avoiding the starvation loop.\n\n#### Rule H: Hyperdisk Incompatibility with Older Generation Machines\n\n- **Problem**: A workload using Hyperdisk (e.g. `hyperdisk-balanced`, `hyperdisk-throughput`, `hyperdisk-extreme`, or StorageClass with hyperdisk CSI provisioner) uses a CCC definition whose 1st choice is a 3rd\u002F4th generation machine type (e.g. `c3-standard-4`, `c4-standard-4`), but has fallbacks to older generation machine types (e.g. `c2`, `n2`, `e2`). Once there is a stockout on the 1st choice, Cluster Autoscaler falls back to an incompatible machine type (`c2`, `n2`, `e2`) that does not support Hyperdisk, causing scale-up to fail.\n- **Fix**: Increase CCC fallback options to other machine families compatible with Hyperdisk (e.g. `c3`, `c4`, `n4`, `c3d`), and remove fallbacks which do not work with Hyperdisk (`c2`, `n2`, `e2`).\n",{"name":5,"metadata":23,"description":7},{"category":24},"Containers","main","af354bf2b99e17df77e52c512a7ba968c37c2306","agents\u002Fplatform\u002Fskills\u002Fcapacity-obtainability",44,"https:\u002F\u002Fgithub.com\u002Fgke-labs\u002Fkube-agents","https:\u002F\u002Fgke-labs.github.io\u002Fkube-agents\u002F","https:\u002F\u002Fgithub.com\u002Fgke-labs","2026-11-14 20:53:19",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add gke-labs\u002Fkube-agents --skill capacity-obtainability",{"tool":39,"command":40},"bunx","bunx skills add gke-labs\u002Fkube-agents --skill capacity-obtainability",{"tool":42,"command":43},"pnpm","pnpm dlx skills add gke-labs\u002Fkube-agents --skill capacity-obtainability","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgke-labs\u002Fkube-agents\u002Fblob\u002Fmain\u002Fagents\u002Fplatform\u002Fskills\u002Fcapacity-obtainability\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":18},"01M72168JZM6CYRZFWW204PA2V","gke-workload-troubleshooting","Diagnoses GKE workload failures (CrashLoopBackOff, OOMKilled, ImagePullBackOff, Pending, etc.) via logs and events. Use when pods fail to start or crash repeatedly. Don't use for GKE cluster infrastructure provisioning, node pool creation, or non-Kubernetes Google Cloud services.","https:\u002F\u002Fgithub.com\u002Fgke-labs\u002Fkube-agents\u002Fblob\u002Fmain\u002Fthird_party\u002Fgoogle-skills\u002Fgke-workload-troubleshooting\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M721643JPG43MFDHGN067D7T","gke-workload-security","Audits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running security audits (`audit_cluster.sh`), enforcing Network Policies (default-deny and Dataplane V2 logging), isolating high-risk pods inside GKE Sandbox (`gVisor`), enforcing Pod Security Standards (`restricted` labeling) and pod securityContext, and mounting Secret Manager secrets via CSI (`SecretProviderClass`). Use when auditing workload security posture, isolating namespaces, applying pod security standards, or configuring network policies and secret volume mounts. Don't use for Workload Identity (use gke-workload-identity), cluster-wide control plane security, RBAC hardening, Binary Authorization, Shielded Nodes, or enabling platform-level GKE add-ons (use gke-platform-security instead).","https:\u002F\u002Fgithub.com\u002Fgke-labs\u002Fkube-agents\u002Fblob\u002Fmain\u002Fthird_party\u002Fgoogle-skills\u002Fgke-workload-security\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M721618QGFKZRWHS0RFVG7WT","gke-workload-scaling","Manages scaling for GKE workloads using HPA and VPA. Use when configuring Horizontal Pod Autoscaler (HPA), configuring Vertical Pod Autoscaler (VPA), or applying best practices for GKE workload autoscaling. Do not use for cluster-level autoscaling (Cluster Autoscaler), static cluster sizing, or configuring node-level machine styles directly.","https:\u002F\u002Fgithub.com\u002Fgke-labs\u002Fkube-agents\u002Fblob\u002Fmain\u002Fthird_party\u002Fgoogle-skills\u002Fgke-workload-scaling\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M7215WA1TNFDZE22VJEN3XXW","gke-workload-identity","Configures and diagnoses Workload Identity Federation for GKE authentication failures for Pods (403 \"iam.serviceAccounts.getAccessToken\" \u002F permission denied, \"could not find default credentials\", or GKE metadata server unreachable) by verifying cluster and node-pool Workload Identity configuration, the Kubernetes ServiceAccount (KSA) to IAM binding (direct principal binding and legacy Google ServiceAccount impersonation), target-resource IAM roles, and gke-metadata-server health. Use when setting up KSA\u002FGSA bindings (`roles\u002Fiam.workloadIdentityUser`, `iam.gke.io\u002Fgcp-service-account`) or when a Pod cannot authenticate to Google Cloud APIs. Don't use for in-cluster Kubernetes RBAC errors (API-server authorization), general workload crashes (use gke-workload-troubleshooting), or Pod Security Standards and NetworkPolicies (use gke-workload-security).","https:\u002F\u002Fgithub.com\u002Fgke-labs\u002Fkube-agents\u002Fblob\u002Fmain\u002Fthird_party\u002Fgoogle-skills\u002Fgke-workload-identity\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M7215PJTBTZ0W15ZZ2W32FF9","gke-upgrades","Plans, executes, and validates Google Kubernetes Engine (GKE) cluster upgrades and maintenance operations for both Standard and Autopilot clusters. Produces upgrade plans, pre\u002Fpost-upgrade checklists, maintenance runbooks with gcloud commands, release channel strategy, and troubleshooting guides. Handles node pool upgrade strategies (surge, blue-green), version compatibility, PDB management, and workload-specific concerns (stateful, GPU, operators). Use this skill whenever the user mentions GKE upgrades, Kubernetes version bumps, node pool maintenance, GKE patching, cluster version management, release channel selection, maintenance windows, surge upgrades, stuck upgrades, or any GKE lifecycle management task — even casual mentions like \"we need to upgrade our clusters\" or \"plan our next GKE maintenance\" or \"our upgrade is stuck.\" Don't use for GKE cluster creation, application onboarding, general networking\u002Frouting setup, or security policy configurations (use gke-basics or relevant GKE skills instead).","https:\u002F\u002Fgithub.com\u002Fgke-labs\u002Fkube-agents\u002Fblob\u002Fmain\u002Fthird_party\u002Fgoogle-skills\u002Fgke-upgrades\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M7215JX0FBZBTG4570CJ20HS","gke-tpu-metrics-monitoring","Monitors and troubleshoots GKE TPU workloads, nodes, and node pools using GKE system metrics and PromQL. Use when monitoring TensorCore duty cycle, TPU memory, node readiness, multi-host TPU node pool availability, host maintenance or preemption interruptions, and calculating MTTR or MTBI metrics for GKE TPUs. Don't use for general non-TPU GKE workload monitoring or non-metric TPU debugging.","https:\u002F\u002Fgithub.com\u002Fgke-labs\u002Fkube-agents\u002Fblob\u002Fmain\u002Fthird_party\u002Fgoogle-skills\u002Fgke-tpu-metrics-monitoring\u002FSKILL.md",[],[]]