GKE Upgrades

GKE Upgrades

Plans, runs and validates GKE cluster upgrades and maintenance, producing upgrade plans, checklists and runbooks tailored to cluster mode, release channel and workload type.

Skill files5 files

references/

SKILL.md253 lines
1
---
2
name: gke-upgrades
3
metadata:
4
version: "1.1.2"
5
category: Containers
6
description: >-
7
Plans, executes, and validates Google Kubernetes Engine (GKE) cluster upgrades
8
and maintenance operations for both Standard and Autopilot clusters. Produces
9
upgrade plans, pre/post-upgrade checklists, maintenance runbooks with gcloud
10
commands, release channel strategy, and troubleshooting guides. Handles node
11
pool upgrade strategies (surge, blue-green), version compatibility, PDB
12
management, and workload-specific concerns (stateful, GPU, operators). Use this
13
skill whenever the user mentions GKE upgrades, Kubernetes version bumps, node
14
pool maintenance, GKE patching, cluster version management, release channel
15
selection, maintenance windows, surge upgrades, stuck upgrades, or any GKE
16
lifecycle management task — even casual mentions like "we need to upgrade our
17
clusters" or "plan our next GKE maintenance" or "our upgrade is stuck." Don't
18
use for GKE cluster creation, application onboarding, general networking/routing
19
setup, or security policy configurations (use gke-basics or relevant GKE skills
20
instead).
21
---
22
23
# GKE Upgrades & Maintenance
24
25
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.
26
27
Always frame guidance around the auto-upgrade model: auto-upgrade with maintenance windows and exclusions is the preferred control mechanism.
28
29
## Attribution
30
31
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
32
MUST read [Usage Attribution](references/attribution.md). For commands executed
33
directly in the terminal (never in generated scripts, Terraform, or user code),
34
prefix `gcloud` with
35
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-upgrades)"`
36
and append `agent-skills/1.0 (skill:gke-upgrades)` to `User-Agent` headers.
37
38
## Context Gathering
39
40
Before producing any upgrade artifact, establish:
41
42
- **Cluster mode** — Standard or Autopilot? (Autopilot has no node pool management, mandatory resource requests, no SSH)
43
- **Current and target versions** — Node version skew must be within 2 minor versions of control plane.
44
- **Release channel** — Rapid, Regular, Stable, or Extended.
45
- **Environment topology & Rollout Sequencing** — Single vs multi-cluster, dev/staging/prod tiers, and whether Rollout Sequencing is used.
46
- **Workload sensitivity** — StatefulSets, databases, GPU, long-running batch need special handling.
47
48
If the user provides these upfront, skip straight to the deliverable. If they're vague, fill in reasonable defaults and flag assumptions.
49
50
## Core Principles
51
52
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.
53
54
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.
55
2. **Control plane first** -- Control plane must be upgraded before node pools. Nodes can trail by up to 2 minor versions.
56
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.
57
4. **Workload-aware** -- Upgrade strategy depends on what's running (stateless, stateful, GPU, batch).
58
5. **Release channels first** -- Always recommend release channels. Note that "No channel" (static versioning) is deprecated and clusters should be migrated to release channels.
59
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.
60
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.
61
62
## Release Channels
63
64
| Channel | Best for | SLA |
65
|---------|----------|-----|
66
| **Rapid** | Dev/test, early feature access | No upgrade stability SLA |
67
| **Regular** (default) | Most production | Full SLA |
68
| **Stable** | Mission-critical, stability-first | Full SLA |
69
| **Extended** | Compliance, EoS enforcement control | Full SLA |
70
71
### Support Lifecycle
72
Standard GKE versions are supported for 14 months after they become available in the **Regular** channel. This means:
73
74
- **Rapid** channel versions may be supported for longer than 14 months (since they enter Rapid before Regular).
75
- **Stable** channel versions may be supported for less than 14 months (since they enter Stable after Regular).
76
- **Extended** support extends this period up to 24 months. Note that extra cost applies only during the extended support period (months 15-24).
77
78
### Current Capabilities
79
80
- **Extended channel math**: 14 months of standard support + ~10 months of extended support ≈ 24 months total per minor version. Even on Extended, forced upgrades still occur: if you take no action, GKE auto-upgrades the cluster at End of Support — averaging a minor version bump roughly every 4 months, the same cadence as other channels (features just arrive later).
81
- **Upgrade reliability (KubeCon NA 2025)**: Google reports a 99.99% upgrade success rate across GKE control planes and nodes, with safe rollback and skip-version upgrade support positioned to let teams upgrade less often (e.g., annually instead of quarterly). Pilot skip-version upgrades in non-production clusters first.
82
- **Autoscaled blue-green node upgrades** (Preview): a blue-green variant that scales the green pool on demand instead of pre-provisioning a full duplicate pool — for disruption-sensitive workloads that cannot reserve 2x capacity.
83
- **Scheduled cluster upgrade notifications** (Preview): opt in to be notified ahead of scheduled minor upgrades and wire the notifications into alerting.
84
- **Graceful termination and PDBs during drains**: blue-green (including autoscaled blue-green, Preview) is the *only* strategy that honors `terminationGracePeriodSeconds` for up to 24 hours; surge upgrades honor it for up to 60 minutes. During node drains, GKE respects PDBs for a maximum of 60 minutes, after which pods are force-deleted (a notification is sent).
85
86
## Maintenance Windows & Exclusions
87
88
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.
89
90
**Exclusion types & Limits:**
91
92
- **"No upgrades" (Scope: `no_upgrades`)**: Blocks all upgrades (minor, patch, node).
93
- **Limits**: Max **90 days per exclusion**, and a cluster can have at most **3** such exclusions. Together they must still allow at least **48 hours of maintenance availability in any rolling 92-day window** — so you cannot chain them into a continuous freeze longer than 90 days. GKE recommends keeping these under 30 days.
94
- **"No minor or node upgrades" (Scope: `no_minor_or_node_upgrades`)**: Blocks minor and node upgrades, but allows control plane patch upgrades (low risk).
95
- **Limit**: No fixed day cap — bounded by the minor version's **End of Support (EoS)**. Recommendation: keep under ~6 months.
96
- **"No minor upgrades" (Scope: `no_minor_upgrades`)**: Blocks minor upgrades, but allows control plane patches and node upgrades.
97
- **Limit**: No fixed day cap — bounded by EoS. Recommendation: keep under ~6 months.
98
99
**Important Exclusion Rules (MUST follow when recommending exclusions and MUST include in the final text response):**
100
101
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.
102
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.
103
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.
104
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.
105
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.
106
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).
107
108
## Mandatory Upgrade Overrides
109
110
GKE reserves the right to override user-defined maintenance windows and exclusions for mandatory operations. These overrides cannot be disabled or blocked.
111
112
**Common Override Scenarios:**
113
114
- **Critical Security Patches**: Urgent vulnerability fixes that must be applied immediately to protect infrastructure.
115
- **End of Support (EoS) / End of Life (EOL) Enforcement**: If a cluster is running an unsupported version, GKE will force upgrade it to a supported version.
116
- **Expiring Certificates**: If control plane certificates (CAs) are expiring (within 30 days) and rotation is required to prevent cluster unrecoverability.
117
- **Maintenance Starvation**: GKE requires at least 48 hours of maintenance availability in any rolling 92-day window. If exclusions block too much, GKE may force an upgrade.
118
119
**Guidance (MUST follow when overrides are discussed):**
120
121
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).
122
2. **Design for Resilience**: Workloads must be designed to survive unexpected control plane or node rotation. You MUST recommend:
123
- Regional clusters (multi-master) to ensure API availability during control plane upgrades.
124
- Multi-zone workload deployments.
125
- Replicas > 1 for critical deployments.
126
- Properly configured Pod Disruption Budgets (PDBs) that are not overly restrictive.
127
128
## Upgrade Planning
129
130
When asked to plan an upgrade, produce a structured document covering:
131
132
- Version compatibility (breaking changes, deprecated APIs) (minor version upgrades only)
133
- Upgrade path (sequential minor version upgrades) (minor version upgrades only)
134
- Node pool upgrade strategy (Standard only)
135
- Workload readiness (PDBs, resource requests)
136
- Rollback/Contingency procedure (how to revert node pools or coordinate with GKE Support for master rollback)
137
138
**Compatibility Search Rule:**
139
140
- If compatibility information (e.g., third-party operator compatibility, GPU driver/CUDA compatibility matrix) is not immediately available in the workspace or via a quick web search, **do NOT loop or make multiple search attempts**. Instead, list the compatibility verification as a **critical pre-upgrade action item** for the user in the checklist.
141
142
### Node Pool Strategy (Standard Only)
143
144
Recommend **Surge upgrade** as the default and most common strategy, with per-pool settings:
145
146
- **Stateless**: Higher `maxSurge` (2-3) for speed, `maxUnavailable=0` for safety.
147
- **Stateful/DB**: `maxSurge=1, maxUnavailable=0` (conservative).
148
- **GPU (fixed reservation)**: `maxSurge=0, maxUnavailable=1` (no surge capacity).
149
- **Large (50+ nodes)**: `maxSurge=20, maxUnavailable=0` (max parallelism).
150
151
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.
152
153
**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.
154
155
For standard command sequences and runbook templates, see [`references/runbook-template.md`](references/runbook-template.md).
156
157
### Large-Scale AI/ML Clusters (GPU/TPU)
158
159
When advising on GPU/TPU upgrades, you MUST cover all of the following:
160
161
- **No Live Migration**: GPU VMs do not support live migration; GKE upgrades will force pod restarts. Explain this to the user.
162
- **Fixed Reservations & Quota**: H100/A100 typically use fixed reservations with no spare quota. Recommend a **rolling upgrade with zero surge** (`maxSurge=0, maxUnavailable=1`), which releases the reservation of the node being upgraded before provisioning its replacement. Explain that **Blue-Green upgrades are not feasible** here because they require double (2x) the GPU resources (both quota and reservations) during the transition.
163
- **Driver Coupling**: The GPU driver is tightly coupled to the node OS image, so node upgrades introduce new Linux kernels and NVIDIA drivers that can break CUDA compatibility. Advise upgrading and testing CUDA compatibility in a staging environment/cluster first, and updating workload dependencies (CUDA version in container images) to match the new driver before attempting the upgrade again. To diagnose driver regressions, compare OS image, kernel version (`uname -r`), and driver versions between old (working) and new (non-working) nodes, and deploy a test pod (e.g., vector addition) to verify GPU access. If production is blocked, rolling the node pool back to the previous version is the quickest mitigation.
164
- **Operational Safety**: Recommend GKE **maintenance exclusions** to block auto-upgrades during active training campaigns. Prior to manual upgrades, cordon GPU nodes and wait for active training jobs to checkpoint/complete.
165
- **TPU Considerations**: TPU slices are recreated atomically (not rolling); maintenance on one slice restarts all slices in the environment.
166
167
## Checklists
168
169
Produce checklists as copyable markdown with checkboxes. See [`references/checklists.md`](references/checklists.md) for the full pre-upgrade and post-upgrade checklist templates. Adapt them to the user's environment.
170
171
**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.
172
173
**Autopilot Checklists:** For Autopilot clusters, ensure the checklists include:
174
175
- Verification of `resources.requests` on all containers (Autopilot requirement).
176
- You MUST include specific `kubectl` commands for API deprecation checks, specifically: `kubectl get --raw /metrics | grep apiserver_request_total | grep deprecated` to check if any active workloads are using deprecated APIs.
177
- Verifying PDBs to ensure they don't block node drain (even though GKE manages nodes, PDBs are still respected).
178
- Identifying and deleting "bare pods" (pods not managed by a ReplicaSet/Deployment/StatefulSet) as they won't be rescheduled during node recreation.
179
- Verification of `terminationGracePeriodSeconds` to ensure pods have enough time to shut down gracefully during node recreation.
180
181
## Maintenance runbooks
182
183
Produce step-by-step runbooks with actual `gcloud` and `kubectl` commands. See
184
[`references/runbook-template.md`](references/runbook-template.md) for the
185
standard command sequences.
186
187
**Any runbook that relaxes a safety control must restore it in the same
188
runbook.** This applies above all to PDBs during a node-pool migration or
189
rollback: back the PDBs up before draining, and make restoring them by patch a
190
numbered step with its own verification, not a closing remark. A runbook that
191
patches `maxUnavailable: 100%` to unblock a drain and never reverts it leaves
192
the cluster without disruption protection, and the gap is invisible until the
193
next voluntary eviction. The same rule covers maintenance exclusions, cordons,
194
and autoscaler `minNodes` overrides added to get through the procedure.
195
196
## Maintenance Window Pauses
197
198
When diagnosing a "stuck" upgrade, consider if it was paused by a maintenance
199
window:
200
201
- **Silent Pause Behavior:** If a maintenance window closes before an automatic
202
surge upgrade completes (manual `gcloud container clusters upgrade` operations
203
bypass maintenance windows), GKE intentionally pauses the rollout to prevent
204
disruption outside allowed times. A blue-green node-pool upgrade does not
205
pause: it continues past the window to completion (see
206
[`references/troubleshooting.md`](references/troubleshooting.md)), so for a
207
blue-green pool the window is not the cause and the rest of this section does
208
not apply.
209
- **Mixed-Version State:** The cluster is left in a stable mixed-version state (some nodes upgraded, some not). You MUST explicitly state that this is a supported and safe intended outcome.
210
- **Resumption:** The upgrade will automatically resume when the next maintenance window opens.
211
- **Mitigation for immediate completion:** If the user wants to complete the
212
upgrade immediately, you MUST suggest **temporarily widening the maintenance
213
window** to include the current time (at least 4 hours total with well over
214
1 hour remaining, because GKE will not start an auto-upgrade with under
215
1 hour left in the window and resumption takes ~5-30 minutes): first save the
216
current `maintenancePolicy` (`gcloud container clusters describe ...
217
--format="yaml(maintenancePolicy)"`), run `gcloud container clusters update`
218
with `--maintenance-window-start`, `--maintenance-window-end`, and
219
`--maintenance-window-recurrence`, and restore the saved `maintenancePolicy`
220
once the upgrade finishes. Do not suggest triggering a manual upgrade or
221
bypassing the window unless the user explicitly asks, so agents keep upgrades
222
inside the user's configured maintenance policy.
223
224
## Troubleshooting
225
226
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:
227
228
1. **PDB blocking drain:** Identify if any PDB has `ALLOWED DISRUPTIONS = 0` using `kubectl get pdb -A`.
229
2. **Resource constraints:** Check if pods are stuck in `Pending` due to capacity limits.
230
3. **Bare pods:** Identify pods without owner references that are blocking the drain (recommend deleting them).
231
4. **Admission webhooks:** Check if Validating/Mutating webhooks are rejecting pod creation on new nodes.
232
5. **PVC attachment issues:** Check for volume attachment failures (especially zone constraints).
233
234
**Stockout / Quota Exhaustion Rule:**
235
236
- If the upgrade is stuck due to `ZONE_RESOURCE_POOL_EXHAUSTED` (stockout) or `QUOTA_EXCEEDED` for Compute Engine resources:
237
1. Recommend modifying the upgrade strategy to `maxSurge=0` (rolling in-place) to bypass quota limits.
238
2. For `QUOTA_EXCEEDED`, suggest requesting a quota increase from Google Cloud.
239
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.
240
241
Refer to [`references/troubleshooting.md`](references/troubleshooting.md) for the exact diagnostic commands and fix procedures for each step.
242
243
## References
244
245
- [GKE Release Notes](https://cloud.google.com/kubernetes-engine/docs/release-notes)
246
- [Upgrading GKE Clusters](https://cloud.google.com/kubernetes-engine/docs/how-to/upgrading-a-cluster)
247
- [Troubleshoot GKE upgrades](https://docs.cloud.google.com/kubernetes-engine/docs/troubleshooting/upgrades.md.txt)
248
- [Get upgrade information (upgrade assist)](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/upgrade-assist.md.txt)
249
- [Node pool upgrade strategies (surge & blue-green)](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-pool-upgrade-strategies.md.txt)
250
- [Maintenance Windows & Exclusions](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions)
251
- [Rollout Sequencing Concepts](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/rollout-sequencing/about-rollout-sequencing)
252
- [Configure Rollout Sequencing](https://cloud.google.com/kubernetes-engine/docs/how-to/rollout-sequencing/manage-upgrades-with-rollout-sequencing)
253

© Google LLC · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…