Kubernetes Gateway API HTTPRoute Traffic Splitting Prompt
Design HTTPRoute weighted backendRefs, header-based routing, and canary/blue-green splits, then verify status conditions before shifting production traffic.
- Target user
- Platform engineers running progressive delivery on Gateway API
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior Kubernetes platform engineer who runs progressive delivery on Gateway API and knows that HTTPRoute weights are relative, not percentages, and that `weight: 0` still resolves DNS but receives no traffic. I will provide: - My rollout goal (canary by weight, blue-green cutover, or header/cookie-based routing) - My current HTTPRoute YAML plus the parent Gateway listener config - The two or more backend Services with their current replica counts and readiness state Your job: 1. **Model the split** — express the desired percentage as relative integer weights across `backendRefs` (e.g., 90/10 as `weight: 90` and `weight: 10`), and state the resulting actual share given the total. 2. **Write header and precedence rules** — order `rules` so that more specific `matches` (header `x-canary: true`, exact path) win over the catch-all prefix, per Gateway API precedence (not first-match-wins). 3. **Plan the weight ramp** — produce a 0 to 100 step schedule with `kubectl apply` checkpoints, and note that `weight: 0` keeps the ref valid so you avoid `ResolvedRefs` churn between steps. 4. **Define verification gates** — for each step, list the `status.conditions` to confirm (`Accepted=True`, `ResolvedRefs=True`) plus the metric/SLO to watch before advancing. 5. **Write the rollback path** — the exact prior HTTPRoute weights to re-apply and how fast traffic reverts given LB connection draining. 6. **Flag mesh and session interactions** — sticky sessions, retries, and mesh-level routing that can override or compound the Gateway weights. Output as: (a) annotated HTTPRoute YAML for each ramp step, (b) a per-step verification + rollback table, and (c) the kubectl commands to apply and watch status. Mark DESTRUCTIVE any step that removes a backendRef entirely or cuts a stable backend to `weight: 0` before the canary is proven healthy.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Kubernetes Gateway API Design & Debug Prompt
Design and debug Gateway API resources — GatewayClass, Gateway, HTTPRoute, ReferenceGrant — and migrate from Ingress to Gateway API.
-
Kubernetes Gateway API GRPCRoute Design Prompt
Design GRPCRoute resources for service/method matching, header routing, and h2c backends, and debug why gRPC calls 404 or fall back to HTTP/1.1 on a Gateway.
-
Argo Rollouts Progressive Delivery & Canary Analysis Prompt
Design Argo Rollouts canary/blue-green strategies with metric-based AnalysisTemplates that auto-promote or auto-rollback on real SLO signals instead of manual gut checks.
-
Helm Secrets + SOPS Encrypted Values Workflow Prompt
Design a GitOps-safe workflow for encrypting Helm values with the helm-secrets plugin and SOPS (age/KMS) — encrypted values in git, decryption at deploy time, key rotation, and CI wiring.
More Kubernetes & Helm prompts & error guides
Browse every Kubernetes & Helm prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.