Skip to content

Clarify legacy AI Gateway cutover steps - #1275

Merged
aponcedeleonch merged 6 commits into
mainfrom
migrate-guide-cleanup
Oct 27, 2026
Merged

aponcedeleonch merged 6 commits into
mainfrom
migrate-guide-cleanup

Conversation

@aponcedeleonch

Copy link
Copy Markdown
Member

Description

Updates the legacy AI Gateway migration guide with what an end-to-end migration needed in practice. The gaps came up while removing the legacy gateway from Stacklok's dev and staging clusters (stacklok/infra#6058, stacklok/infra#6059). Everything below was checked against the umbrella chart and the operator source.

  • Side by side: a fifth responsibility. Attach the AI Gateway's httpRoute to a Gateway that survives the cutover. The operator deletes the GatewayClass named in spec.gateway.gatewayClassName when the AIGateway goes, even one it didn't create, and disabling the legacy gateway removes its bundled Envoy Gateway controller.
  • Step 4: move platform callers too, such as enterprise-manager.budgets.classifier.baseURL.
  • Step 5: confirm traffic has stopped with aigw_token_usage_total, wait until kubectl get aigateway is empty, and reconcile this step on its own under GitOps. The operator's finalizer must run before step 6 removes the operator.
  • Step 6: list the values and resources to remove. These are the legacy allowlist subjects, directoryGrpcEndpoint (with the exact condition under which the AI Gateway inherits it), operator overrides, gatewayApiUrl, and out-of-chart resources. It also says which CRDs stay. The -api-key-service subject has to go in this same change, because the chart guard requires it while the legacy gateway is enabled.
  • Nit: keep provider Secrets that a providers[].credentialSecretRef still names.
  • Troubleshooting: recovery for an AIGateway stuck in Terminating.

The "Disconnect AI Gateway stops traffic on both" line stays as is. On v2-only installs the console hid that switch, which is a product bug fixed in stacklok/stacklok-enterprise-platform#5650.

Type of change

  • Documentation update

Related issues/PRs

  • stacklok/stacklok-enterprise-platform#5650
  • stacklok/infra#6058, stacklok/infra#6059

Submitter checklist

Content and formatting

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

npm run prettier, npm run eslint on the page, and npm run build pass, with no broken links.

Reviewer checklist

Content

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

🤖 Generated with Claude Code

Add what an end-to-end migration to AI Gateway v2 needed in practice:

- Attach the AI Gateway route to a Gateway that survives the cutover.
  Deleting the AIGateway removes its GatewayClass, and disabling the
  legacy gateway removes its Envoy Gateway controller.
- Confirm legacy traffic is gone before deleting the AIGateway, and
  move platform callers such as the budgets classifier.
- Wait for the AIGateway to finish deleting before disabling the legacy
  gateway, and split the two steps under GitOps.
- List the values and resources to remove when disabling the legacy
  gateway, with the exact condition for keeping directoryGrpcEndpoint.
- Keep provider Secrets that a credentialSecretRef still names.
- Add troubleshooting for an AIGateway stuck in Terminating.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Alejandro Ponce <aponcedeleonch@stacklok.com>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 12:42
@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs-website Ready Ready Preview Oct 26, 2026 1:36pm UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The token-usage check can miss ongoing client requests before gateway deletion and should use request-level evidence.

1 open issue
What changed in this PR

Clarifies the legacy AI Gateway migration guide with cutover sequencing and cleanup steps based on practical migrations.

Changes:

  • Adds Gateway ownership requirements and migration steps for platform callers.
  • Expands deletion checks, GitOps sequencing, and legacy configuration cleanup.
  • Adds recovery instructions for an AIGateway stuck in Terminating.
File Description
docs/​ai-gateway/​migrate-from-legacy.mdx Expands cutover prerequisites, cleanup steps, and finalizer troubleshooting.

Review effort: Balanced

Comment thread docs/ai-gateway/migrate-from-legacy.mdx Resolved
A flat aigw_token_usage_total doesn't prove clients stopped calling
the legacy gateway, since rejected requests consume no tokens. The
Envoy request counter covers those too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The budgets classifier is an internal experimentation feature and
shouldn't appear in published docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aponcedeleonch and others added 2 commits October 26, 2026 15:31
The requirement is that the AI Gateway isn't published through
anything the legacy stack owns, whatever ingress the customer uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match the Envoy Gateway prerequisite on the configure page, and
explain why the AI Gateway needs its own Envoy Gateway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the platform callers note, since no caller besides the internal
classifier needed moving. Scope the request metric check away from
Envoy Gateway's readiness and stats listeners, which keep counting
from probes and scrapes, and wait for active requests to drain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The checklist still omits platform-caller migration, which can leave the conversation classifier using the legacy gateway after cutover.

1 open issue
1 resolved since last review

Review effort: Balanced

5. **Delete the `AIGateway` resource** once no traffic reaches it. Do this
before step 6, while the AI Gateway operator is still installed, so the
operator cleans up the resources it created.
5. **Delete the `AIGateway` resource** once no traffic reaches it. On the legacy
@aponcedeleonch
aponcedeleonch merged commit 985ad61 into main Oct 27, 2026
13 checks passed
@aponcedeleonch
aponcedeleonch deleted the migrate-guide-cleanup branch October 27, 2026 08:39

This branch was successfully deployed

1 active deployment
Preview — 79303493 Deployed Oct 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants