Gke upgrades

From vaila-multimodaltoolbox/vaila · View interactive version

Gke upgrades is an AI agent skill from the GitHub repository vaila-multimodaltoolbox/vaila. Plans, executes, and validates Google Kubernetes Engine (GKE) cluster upgrades and maintenance operations for both Standard and Autopilot clusters. Produces upgrade plans, pre/post-upgrade checklists, maintenance runbooks with gcloud commands, release channel strategy, and troubleshooting guides. Ha

How to use this skill

Skill file

GKE Upgrades & Maintenance

Produce clear, actionable documents — upgrade plans, runbooks, or checklists — tailored to the user's environment. Output should be specific to their cluster mode, release channel, version, and workload types rather than generic advice.

Always frame guidance around the auto-upgrade model: auto-upgrade with maintenance windows and exclusions is the preferred control mechanism.

Context Gathering

Before producing any upgrade artifact, establish:

If the user provides these upfront, skip straight to the deliverable. If they're vague, fill in reasonable defaults and flag assumptions.

Core Principles

GKE versions follow Kubernetes version terminology: Major.Minor.Patch (e.g., 1.30.1-gke.1187000). A Minor version bump (e.g., 1.29 → 1.30) introduces new features and APIs. A Patch version bump (e.g., 1.30.1 → 1.30.2) introduces security and bug fixes. Ensure the user understands this distinction.

  1. Sequential control plane, skip-level node pools -- Control plane upgrades are sequential (N → N+1 → N+2). Node pools support skip-level (N+2) upgrades.
  2. Control plane first -- Control plane must be upgraded before node pools. Nodes can trail by up to 2 minor versions.
  3. Environment progression -- Always upgrade dev/staging before production. Use Rollout Sequencing (preferred) to automate and enforce this progression across environments (e.g., dev → staging → prod), or manually coordinate version progression if Rollout Sequencing is not used.
  4. Workload-aware -- Upgrade strategy depends on what's running (stateless, stateful, GPU, batch).
  5. Release channels first -- Always recommend release channels. Note that "No channel" (static versioning) is deprecated and clusters should be migrated to release channels.
  6. Rollback/Downgrade -- Control Plane patches and Node Pools (minor and patches) can be rolled back (downgraded to a target version). GKE supports a 2-step Control Plane minor upgrade where step 1 is rollbackable. Other Control Plane minor version rollbacks are NOT customer-doable and require GKE Support.
  7. Node pool upgrade ordering -- When upgrading multiple node pools, always recommend sequential ordering: upgrade non-critical/stateless pools first (acting as a canary) to verify cluster health before upgrading critical stateful (database) or GPU pools.

Release Channels

| Channel | Best for | SLA |

|---------|----------|-----|

| Rapid | Dev/test, early feature access | No upgrade stability SLA |

| Regular (default) | Most production | Full SLA |

| Stable | Mission-critical, stability-first | Full SLA |

| Extended | Compliance, EoS enforcement control | Full SLA |

Support Lifecycle

Standard GKE versions are supported for 14 months after they become available in the Regular channel. This means:

Current Capabilities

Maintenance Windows & Exclusions

Configure maintenance windows to control auto-upgrade timing. GKE also supports node pool level maintenance exclusions (in addition to cluster level) to block upgrades for specific workloads.

Exclusion types & Limits:

Important Exclusion Rules (MUST follow when recommending exclusions and MUST include in the final text response):

  1. Auto-upgrades only: Maintenance exclusions only block automatic upgrades. Manual upgrades initiated by the user will bypass exclusions. You MUST explain this to the user.
  2. Warn against "No channel": You MUST explicitly warn that disabling release channels ("No channel" / static versioning) is deprecated and must not be used as a replacement for exclusions.
  3. Compare Scopes: You MUST explain the difference between 'No upgrades' (limitations, blocks patches) and 'No minor or node upgrades' (allows patches, longer duration). Recommend 'No minor or node upgrades' when the user wants to allow security patches/fixes while blocking minor version jumps.
  4. Handle periods > 90 days: If the user needs to block upgrades for more than 90 days, you MUST explain that 'No upgrades' is limited to 90 days per exclusion (max 3 per cluster, and 48 hours of maintenance availability must remain in any rolling 92-day window, preventing chaining into longer continuous freezes) and advise using scoped exclusions ('No minor or node upgrades' / 'No minor upgrades'), which have no fixed day cap and can run until the minor version's End of Support.
  5. Version skew: Be mindful of version skew (between control plane and node pools) when using exclusions. Ensure skew does not exceed the supported 2 minor versions. Use --add-maintenance-exclusion-until-end-of-support for persistent exclusions.
  6. Correct gcloud syntax: When providing gcloud commands for exclusions, you MUST use the separate flag syntax: --add-maintenance-exclusion-name, --add-maintenance-exclusion-start, --add-maintenance-exclusion-end (or --add-maintenance-exclusion-until-end-of-support), and --add-maintenance-exclusion-scope (do NOT use a single comma-separated --add-maintenance-exclusion flag).

Mandatory Upgrade Overrides

GKE reserves the right to override user-defined maintenance windows and exclusions for mandatory operations. These overrides cannot be disabled or blocked.

Common Override Scenarios:

Guidance (MUST follow when overrides are discussed):

  1. Correlate with Bulletins: If GKE performs an unexpected upgrade, you MUST explicitly suggest checking GKE Release Notes or Security Bulletins to correlate the event with emergency patches (do not just suggest checking Cloud Audit Logs).
  2. Design for Resilience: Workloads must be designed to survive unexpected control plane or node rotation. You MUST recommend:

Upgrade Planning

When asked to plan an upgrade, produce a structured document covering:

Compatibility Search Rule:

Node Pool Strategy (Standard Only)

Recommend Surge upgrade as the default and most common strategy, with per-pool settings:

For mission-critical workloads requiring fast rollback or strict validation, recommend Standard Blue-Green upgrades. Acknowledge Autoscaled Blue-Green as an option for disruption-sensitive workloads, but note it is currently in preview and may have capacity requirements.

Upgrade Ordering (User-initiated only): When planning manual upgrades, specify the sequence of node pool upgrades. Recommend upgrading stateless pools first, verifying cluster stability, and then upgrading stateful/GPU pools. For auto-upgrades, GKE automatically manages sequential node pool upgrades.

For standard command sequences and runbook templates, see CODE0.

Large-Scale AI/ML Clusters (GPU/TPU)

When advising on GPU/TPU upgrades, you MUST cover all of the following:

Checklists

Produce checklists as copyable markdown with checkboxes. See CODE0 for the full pre-upgrade and post-upgrade checklist templates. Adapt them to the user's environment.

Stateful Workloads: When stateful workloads (databases) are present, always include checks for PV backup completion and verification of PV reclaim policies (e.g., Retain vs Delete) in the pre-upgrade checklist.

Autopilot Checklists: For Autopilot clusters, ensure the checklists include:

Maintenance runbooks

Produce step-by-step runbooks with actual gcloud and kubectl commands. See references/runbook-template.md for the standard command sequences.

Any runbook that relaxes a safety control must restore it in the same runbook. This applies above all to PDBs during a node-pool migration or rollback: back the PDBs up before draining, and make re-applying them a numbered step with its own verification, not a closing remark. A runbook that patches maxUnavailable: 100% to unblock a drain and never reverts it leaves the cluster without disruption protection, and the gap is invisible until the next voluntary eviction. The same rule covers maintenance exclusions, cordons, and autoscaler minNodes overrides added to get through the procedure.

Maintenance Window Pauses

When diagnosing a \"stuck\" upgrade, consider if it was paused by a maintenance window:

Troubleshooting

When a user reports a stuck or failing upgrade, you MUST systematically analyze and address ALL 5 potential causes in your final response. Do not omit checks even if you suspect one is the primary cause:

  1. PDB blocking drain: Identify if any PDB has ALLOWED DISRUPTIONS = 0 using kubectl get pdb -A.
  2. Resource constraints: Check if pods are stuck in Pending due to capacity limits.
  3. Bare pods: Identify pods without owner references that are blocking the drain (recommend deleting them).
  4. Admission webhooks: Check if Validating/Mutating webhooks are rejecting pod creation on new nodes.
  5. PVC attachment issues: Check for volume attachment failures (especially zone constraints).

Stockout / Quota Exhaustion Rule:

1. Recommend modifying the upgrade strategy to maxSurge=0 (rolling in-place) to bypass quota limits.

2. For QUOTA_EXCEEDED, suggest requesting a quota increase from Google Cloud.

3. You MUST suggest migrating workloads or creating new node pools in a different zone or region where capacity/quota is available as a mitigation.

Refer to CODE0 for the exact diagnostic commands and fix procedures for each step.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.