Skip to content

blog: Managing AI Workload Egress with Kuadrant#90

Open
maksymvavilov wants to merge 1 commit intomainfrom
egress-blog
Open

blog: Managing AI Workload Egress with Kuadrant#90
maksymvavilov wants to merge 1 commit intomainfrom
egress-blog

Conversation

@maksymvavilov
Copy link
Copy Markdown

@maksymvavilov maksymvavilov commented May 6, 2026

Summary

Tutorial-style blog post covering Kuadrant's egress gateway capabilities for AI workloads calling external APIs (OpenAI as the example):

  • Access control — AuthPolicy with kubernetesTokenReview for workload identity and namespace-based authorization
  • Rate limiting — Per-workload RateLimitPolicy with identity-based counters
  • Credential injection — AuthPolicy + Vault integration for transparent API key injection (SA token in, API key out)
  • Transparent DNS — DNSPolicy overview with diagram and link to full guide

All code blocks are copy-paste bash commands. Includes three mermaid diagrams (overview topology, DNS routing flow, credential injection sequence).

Related: Kuadrant/architecture#145

Checklist

  • Frontmatter follows blog format (title, date, author)
  • All YAML examples validated against CRDs
  • All links verified (using /dev/ for egress guides not yet on /latest/)
  • Steps tested end-to-end on a Kind cluster
  • Mermaid diagrams render (site has mermaid support via layout.njk)

Summary by CodeRabbit

  • Documentation
    • New blog post on managing AI-workload egress with Kuadrant, covering access control, per-workload rate limiting and secure credential injection. Includes architecture diagrams, prerequisites and step‑by‑step setup for integrating with OpenAI, Vault-backed secret storage, optional DNS policy for transparent DNS, deployment and verification procedures, testing scenarios and practical command examples.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 6, 2026

Deploy Preview for relaxed-faloodeh-7fa6f1 ready!

Name Link
🔨 Latest commit bbc64ba
🔍 Latest deploy log https://app.netlify.com/projects/relaxed-faloodeh-7fa6f1/deploys/69fb091f7943020008afa874
😎 Deploy Preview https://deploy-preview-90--relaxed-faloodeh-7fa6f1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@maksymvavilov maksymvavilov moved this to Ready For Review in Kuadrant May 6, 2026
@maksymvavilov maksymvavilov self-assigned this May 6, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6da0e8b6-09cb-43d2-af7b-9e86334af931

📥 Commits

Reviewing files that changed from the base of the PR and between b25923c and bbc64ba.

📒 Files selected for processing (1)
  • src/blog/egress-gateway-ai-workloads.md

📝 Walkthrough

Walkthrough

A new blog post is added at src/blog/egress-gateway-ai-workloads.md explaining how to manage AI workload egress with Kuadrant, covering architecture, Access Control, Rate Limiting, Vault-backed Credential Injection, optional transparent DNS, setup steps for an egress gateway to OpenAI, test scenarios and references (approx. 445 new lines).

Changes

AI Workload Egress Management with Kuadrant

Layer / File(s) Summary
Front Matter & Overview
src/blog/egress-gateway-ai-workloads.md (lines 1–44)
Adds front matter, lead paragraph, feature bullets, "How It Works" and an architecture Mermaid diagram describing egress gateway, policy attachments and TLS origination.
Prerequisites & Gateway Configuration
src/blog/egress-gateway-ai-workloads.md (lines 45–137)
Adds prerequisites checklist and multi-document YAML/shell content to configure Gateway, ServiceEntry, DestinationRule and HTTPRoute for routing egress to OpenAI, plus CLI wait and gateway address export steps.
Vault & Test Workload Deployment
src/blog/egress-gateway-ai-workloads.md (lines 138–197)
Adds Vault Helm install and Kubernetes auth setup, ai-workloads namespace and test pod deployment, and commands to wait for readiness.
Vault KV Setup & Role Bindings
src/blog/egress-gateway-ai-workloads.md (lines 183–197)
Adds KV store creation and Vault role binding commands to map workload identities to stored credentials.
Transparent DNS (Optional)
src/blog/egress-gateway-ai-workloads.md (lines 198–216)
Introduces DNSPolicy concept with a Mermaid diagram and narrative on how kuadrant CoreDNS publishes DNS records for egress using Gateway listener hostnames and statuses.
Access Control (AuthPolicy)
src/blog/egress-gateway-ai-workloads.md (lines 217–247)
Adds AuthPolicy YAML and explanation for workload identity verification, token review, and namespace-based access control for egress.
Rate Limiting
src/blog/egress-gateway-ai-workloads.md (lines 251–275)
Adds RateLimitPolicy YAML demonstrating per-workload limits and tokenization of workload identities.
Credential Injection (Vault-backed)
src/blog/egress-gateway-ai-workloads.md (lines 277–386)
Describes Vault-backed credential injection flow with diagrams, replacement of prior AuthPolicy with Vault-backed injection, and per-workload credential retrieval flow.
Testing Guidance
src/blog/egress-gateway-ai-workloads.md (lines 389–415)
Adds test scenarios, curl examples against OpenAI endpoints (with and without DNSPolicy) and expected authorised/unauthorised outcomes.
Next Steps & References
src/blog/egress-gateway-ai-workloads.md (lines 435–444)
Adds future enhancement bullets and "Learn More" references and related guides.

Sequence Diagram(s)

sequenceDiagram
  participant Workload
  participant Kubernetes_API
  participant Kuadrant_Egress_Gateway
  participant Vault
  participant OpenAI

  Workload->>Kuadrant_Egress_Gateway: HTTPS request (egress)
  Kuadrant_Egress_Gateway->>Kubernetes_API: Validate identity (token review) / AuthPolicy
  Kubernetes_API-->>Kuadrant_Egress_Gateway: Identity verified
  Kuadrant_Egress_Gateway->>Vault: Request credentials for workload (if injection)
  Vault-->>Kuadrant_Egress_Gateway: Return API key
  Kuadrant_Egress_Gateway->>OpenAI: Forward request with injected credentials + rate limit check
  OpenAI-->>Kuadrant_Egress_Gateway: Response
  Kuadrant_Egress_Gateway-->>Workload: Response forwarded
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Through gateways wide where packet rivers flow,
I hop with keys that Vault and policies know.
Auth, limits, DNS aligned in tune,
AI calls safe beneath the moon —
A tiny rabbit cheers the egress show.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'blog: Managing AI Workload Egress with Kuadrant' directly and clearly summarizes the main change—a new blog post about managing AI workload egress with Kuadrant, which matches the changeset perfectly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch egress-blog

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/blog/egress-gateway-ai-workloads.md (1)

176-176: ⚡ Quick win

Avoid :latest image tags in tutorial steps

Using curlimages/curl:latest on Lines 176 and 420 makes the guide non-reproducible over time and can introduce unexpected behaviour changes.

Proposed fix
-      image: curlimages/curl:latest
+      image: curlimages/curl:8.8.0
-kubectl run bad-client --image=curlimages/curl:latest -n default --restart=Never \
+kubectl run bad-client --image=curlimages/curl:8.8.0 -n default --restart=Never \

Also applies to: 420-420

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/blog/egress-gateway-ai-workloads.md` at line 176, The tutorial uses an
unpinned image "curlimages/curl:latest"; replace both occurrences of the string
"curlimages/curl:latest" with a pinned image tag or digest (for example a
specific version like "curlimages/curl:8.x.y" or a SHA256 image digest) so the
steps are reproducible and stable—update every instance (both occurrences
referenced) in the document where "curlimages/curl:latest" appears.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/blog/egress-gateway-ai-workloads.md`:
- Around line 187-188: The Vault kv write command in the kubectl exec invocation
(kubectl exec vault-0 -n vault -- vault kv put
secret/egress/ai-workloads/default) contains an unquoted placeholder
api_key=<your-openai-api-key> which the shell treats as input redirection;
update the argument to quote the value or use a variable expansion (e.g.,
api_key="<your-openai-api-key>" or api_key="$OPENAI_API_KEY") so the placeholder
is passed as a literal value to vault kv put rather than being interpreted by
the shell.
- Line 273: The CEL path used for TokenReview username is incorrect in two
places: replace the string "auth.identity.username" (currently at the occurrence
on line 273) and the string "auth.identity.user.username" (the other occurrence)
with the correct path "auth.identity.status.user.username" so both references
(the CEL expressions used for per-workload rate limiting) consistently use
auth.identity.status.user.username.

---

Nitpick comments:
In `@src/blog/egress-gateway-ai-workloads.md`:
- Line 176: The tutorial uses an unpinned image "curlimages/curl:latest";
replace both occurrences of the string "curlimages/curl:latest" with a pinned
image tag or digest (for example a specific version like "curlimages/curl:8.x.y"
or a SHA256 image digest) so the steps are reproducible and stable—update every
instance (both occurrences referenced) in the document where
"curlimages/curl:latest" appears.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 561c5f25-33ef-4796-96ff-18a3caf93af0

📥 Commits

Reviewing files that changed from the base of the PR and between c895174 and b25923c.

📒 Files selected for processing (1)
  • src/blog/egress-gateway-ai-workloads.md

Comment thread src/blog/egress-gateway-ai-workloads.md Outdated
Comment thread src/blog/egress-gateway-ai-workloads.md
Tutorial-style blog post covering egress gateway capabilities for
AI workloads calling external APIs like OpenAI: access control via
AuthPolicy, per-workload rate limiting, Vault-based credential
injection, and transparent DNS routing with DNSPolicy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Maskym Vavilov <mvavilov@redhat.com>
@maksymvavilov
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

2 participants