Skip to content

feat(kubernetes): support corporate upstream proxy - #2633

Open
loveRhythm1990 wants to merge 1 commit into
NVIDIA:mainfrom
loveRhythm1990:2624-kubernetes-corporate-proxy/lr
Open

feat(kubernetes): support corporate upstream proxy#2633
loveRhythm1990 wants to merge 1 commit into
NVIDIA:mainfrom
loveRhythm1990:2624-kubernetes-corporate-proxy/lr

Conversation

@loveRhythm1990

@loveRhythm1990 loveRhythm1990 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Add Kubernetes support for the existing supervisor corporate HTTP forward-proxy path. This lets sandboxes in proxy-only clusters reach policy-approved TLS destinations through an operator-managed proxy without allowing workloads to choose, bypass, or observe the upstream route.

The Kubernetes driver previously had no configuration or Secret-projection path for the shared supervisor feature that Podman already uses. This PR adds that driver-level plumbing while preserving direct egress as the default when no proxy is configured.

Related Issue

Closes #2624

Changes

  • Add Kubernetes driver configuration for https_proxy, no_proxy, proxy credential Secret name/key, insecure Basic-auth acknowledgement, and CONNECT-by-hostname mode. The URL remains intentionally limited to http:// forward proxies; HTTPS-to-proxy support is out of scope.
  • Expose the configuration through gateway CLI/environment options and Helm upstreamProxy values, while keeping it deployment-owned rather than allowing per-sandbox driver_config overrides.
  • Reuse the shared URL validation and enforce coherent settings at gateway startup: invalid URLs, unpaired Secret fields, invalid Secret names/keys, and unsafe credential settings fail closed.
  • Project credentials as a read-only Kubernetes Secret volume, never as an environment value, annotation, or command-line value. The gateway validates the reference syntax; kubelet resolves Secret existence/key availability when the sandbox Pod starts; the supervisor validates the credential content and rejects malformed files.
  • Require topology = \"sidecar\" whenever proxy credentials are configured. Combined topology shares a container filesystem with the workload, and workspace fsGroup can make an otherwise root-only Secret mount group-readable; rejecting this combination avoids a credential disclosure path. Credential-free proxy configuration can still use Combined topology.
  • Pass upstream arguments only to the network-supervising container. In sidecar mode this is the network sidecar; network-init never receives proxy configuration and the agent container never receives the credential mount.
  • Update the gateway reference, Kubernetes setup guide, compute-driver reference, architecture overview, Helm README, values, and rendering tests.

Testing

  • mise run pre-commit passes
  • Kubernetes driver unit tests and gateway TOML/Helm rendering tests updated
  • Kubernetes mock-proxy e2e: authenticated CONNECT reaches a TLS upstream and policy-denied traffic never reaches the proxy
  • Kubernetes mock-proxy e2e: NO_PROXY bypasses only the corporate proxy; policy-denied traffic remains denied
  • Kubernetes e2e: missing credential Secret fails sandbox creation closed
  • Kubernetes e2e: malformed credential content fails sandbox creation closed
  • mise run test has one unrelated environment-dependent DNS failure: test_forward_public_ip_allowed_without_allowed_ips resolved dns.google to 198.18.1.240, which the SSRF guard correctly rejects. All Kubernetes proxy-specific checks above passed.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

@copy-pr-bot

copy-pr-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@loveRhythm1990
loveRhythm1990 marked this pull request as ready for review August 6, 2026 13:48
@loveRhythm1990
loveRhythm1990 force-pushed the 2624-kubernetes-corporate-proxy/lr branch from bf55d03 to 26493d1 Compare August 6, 2026 13:52
Signed-off-by: loveRhythm1990 <qiuweimin@126.com>
@loveRhythm1990
loveRhythm1990 force-pushed the 2624-kubernetes-corporate-proxy/lr branch from 26493d1 to 78250e4 Compare August 6, 2026 13:52
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.

feat(kubernetes): support corporate HTTP forward proxy egress for sandboxes

1 participant