Skip to content

feat(k8s): support the additional destination CA with shared supervisors - #6080

Open
Gal-Zaidman wants to merge 1 commit into
ai-openshell:mainfrom
Gal-Zaidman:feat/6004-shared-supervisor-additional-ca/Gal-Zaidman
Open

Gal-Zaidman wants to merge 1 commit into
ai-openshell:mainfrom
Gal-Zaidman:feat/6004-shared-supervisor-additional-ca/Gal-Zaidman

Conversation

@Gal-Zaidman

Copy link
Copy Markdown
Contributor

Summary

A gateway with the shared Kubernetes supervisor topology now accepts [openshell.supervisor.network] additional_ca_bundle instead of refusing to start. Each sandbox generation's launch material carries the bundle to the shared supervisor, which appends it to that sandbox's destination trust.

Related Issue

Closes #6004

Changes

  • The gateway no longer refuses the bundle with a shared topology. At startup it refuses a bundle that, with the supervisor OTLP TLS files, exceeds 192 KiB, leaving 64 KiB of the 256 KiB launch material for credentials.
  • The Kubernetes driver puts the normalized PEM in each shared generation's registration and creates no destination-CA ConfigMap for shared generations.
  • The shared supervisor writes the bundle to the instance's private directory (additional-ca.pem, mode 0600) and passes it to the network supervisor.
  • The registration field is omitted when no bundle is set, so supervisors from earlier releases keep working until an operator configures one.
  • The additional_ca e2e test runs against shared supervisors with the new mise run e2e:kubernetes:additional-ca-shared task.
  • The configuration docs, Helm chart README, and debug-openshell-cluster skill describe the shared-topology delivery, its size limit, and the supervisor upgrade order.

Release Notes

additional_ca_bundle now works with shared Kubernetes supervisors. Upgrade the shared supervisors before configuring it.

Testing

  • Checks appropriate to the affected code and behavior pass: cargo fmt, clippy with -D warnings on the affected crates and the e2e crate, unit tests for the Kubernetes driver, supervisor-control, supervisor, and gateway, and mise run helm:test
  • Unit tests added/updated: the shared bundle size check and the private bundle file
  • E2E tests added/updated: mise run e2e:kubernetes:additional-ca-shared passed on a local k3d cluster with a one-member shared supervisor pool. A sandbox trusts the private CA, rejects a hostname mismatch, and keeps public roots. The sandbox namespace gets no managed ConfigMap and no Pod mounts one. After the bundle is removed and the gateway restarts, stop and start drops the private CA for the same sandbox. The conformance suite passed 77 of 77 on the same cluster.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Nov 30, 2026
The gateway no longer refuses [openshell.supervisor.network]
additional_ca_bundle with the shared supervisor topology. The Kubernetes
driver carries the normalized PEM in each generation's launch material,
and the shared host writes it to the instance's private directory for
the network supervisor to append. With a shared topology the gateway
refuses at startup a bundle that, with the supervisor OTLP TLS files,
exceeds 192 KiB, leaving 64 KiB for the rest of the launch material.

Older supervisors refuse launch material carrying the bundle, so
upgrade supervisors before configuring it.

Signed-off-by: Gal Zaidman <gzaidman@nvidia.com>
@gator-review-bot

Copy link
Copy Markdown

gator-agent

Blocked

GitHub reports merge conflicts with main. I deferred the code review until the conflicts are resolved.

Action required: @Gal-Zaidman, please update the PR branch against main and resolve the conflicts so Gator can start the review.

Gator metadata
  • Head SHA: 1984da44054a4a41d6baf5a66b45e94bdb18543f
  • Base SHA: 659b45f3bed896897de20a8b67289916a3d9fffc
  • Merge base SHA: 659b45f3bed896897de20a8b67289916a3d9fffc
  • Patch ID: 8675e46ec0ec1f73e7da0b341a2c6a1e95e0a83b
  • Gator payload: 19
  • Review mode: initial; reviewer deferred for process blockers
  • Next state: gator:blocked
  • Blocked reason: merge_conflict

@gator-review-bot gator-review-bot Bot added the gator:blocked Gator is blocked by process or repository gates label Dec 1, 2026
@johntmyers
johntmyers force-pushed the feat/6004-shared-supervisor-additional-ca/Gal-Zaidman branch from 1984da4 to 0b045b1 Compare December 1, 2026 23:22

@gator-review-bot gator-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

gator-agent

PR Review Status

Thanks @Gal-Zaidman. I checked the updated branch and GitHub reports that the merge conflicts are resolved. The first code review found two blocking problems in how shared supervisors receive the destination CA.

Action required: Validate the encoded launch budget at startup and preserve the CA snapshot when an incomplete start rebuilds the same generation.

Blocking findings:

  • GATOR-0b045b10-01: Startup can accept configuration that exceeds the shared launch limit after encoding.
  • GATOR-0b045b10-02: Replaying a start can change the CA for an already-registered generation.

Carried findings:

  • None.

Non-blocking suggestions:

  • While the extra CA is active, verify rejection of a hostname-matching, policy-permitted endpoint signed by a different CA.
  • Add the focused shared additional-CA test task to the Helm development skill.
Gator metadata
  • Validation: Implements the shared-supervisor destination CA support accepted in #6004.
  • Docs: Fern gateway configuration updated on the existing page.
  • Checks: DCO passed. Branch Checks and Helm Lint await workflow approval.
  • E2E: test:e2e applies once review feedback clears. The current green status indicates the label is absent.
  • Head SHA: 0b045b10f3a702572ebfe7111cdb6c00daefe05c
  • Base SHA: 863a03134ea565140d3ae1bd6b1bad411d77f6be
  • Merge base SHA: 863a03134ea565140d3ae1bd6b1bad411d77f6be
  • Patch ID: 400e5f1fc6177d0835dff10b121257a141be6a6c
  • Gator payload: 19
  • Review mode: initial
  • Specialist consults: review-contracts
  • Previous reviewed SHA: none
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:in-review

let Some(bundle) = bundle else {
return Ok(());
};
let total = bundle.pem().len() + otlp_tls_bytes;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

gator-agent

Warning — GATOR-0b045b10-01 · Budget the encoded shared-supervisor launch data

Summary. A Kubernetes operator using shared supervisors can configure a destination CA bundle and supervisor OTLP headers that pass gateway startup but push every new or restarted sandbox generation over the 256 KiB launch limit. Startup counts the raw CA and OTLP TLS bytes. The launch limit also counts the encoded headers and JSON overhead.

Fix. Keep the 192 KiB raw trust cap and the final per-generation guard. At startup, also budget the encoded CA and effective supervisor OTLP fields, with room for per-generation data. Name additional_ca_bundle and the applicable limit in the startup error.

Verify. With no OTLP TLS files, use a normalized CA bundle of roughly 185 KiB and valid headers of roughly 24 KiB for each of the traces, OCSF, and agent exports. Verify that startup rejects the fixture with the configuration error. The current startup accepts it, and registration serialization rejects the oversized launch. Also check the TLS-only case with a 90–96 KiB normalized destination CA and distinct traces and OCSF HTTPS CA files padded with blank lines to 64 KiB and 32 KiB. With no headers, the raw total is at most 192 KiB, but JSON escaping puts the registration over 256 KiB. Use a config fixture and a minimal registration without contacting a collector.

Agent context
  • Location: crates/openshell-driver-kubernetes/src/driver.rs:5897
  • This PR adds the CA to SandboxInstanceRegistration::to_assignment's existing size budget. It checks the final size before SharedSupervision::launch persists the Secret or assigns the generation.

provisioned.runtime_descriptor,
launch_authentication,
proxy_ca,
self.network_trust_bundle.as_ref(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

gator-agent

Warning — GATOR-0b045b10-02 · Preserve destination trust when replaying a generation

Summary. If the gateway restarts during a shared sandbox's start after the launch Secret was saved but before the sandbox becomes ready, startup recovery can rebuild that same generation using the replacement gateway's CA bundle. A CA rollover or removal can therefore change destination trust for an already-registered generation without a new stop/start after rollover.

Fix. Preserve the persisted CA snapshot, including an unset bundle, when rebuilding the same generation. Use the current gateway snapshot for a new generation or an attempt that never persisted a snapshot.

Verify. Hold readiness after the start operation settles with CA A in the released generation's launch Secret. Restart the gateway with CA B and let startup recovery rebuild that same generation. Its replacement Secret should still carry CA A. A later start that allocates a new generation should carry CA B.

Agent context
  • Location: crates/openshell-driver-kubernetes/src/driver.rs:4035
  • Recovery can call stop_sandbox_inner and delete an incomplete generation's launch Secret before rebuilding it under the same generation ID. The PR reads current driver configuration when it builds the replacement registration. An explicit retry of the same settled start can also take this path.

@gator-review-bot gator-review-bot Bot added gator:in-review Gator is reviewing or awaiting PR review feedback and removed gator:blocked Gator is blocked by process or repository gates labels Dec 1, 2026

This branch has not been deployed

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

Labels

gator:in-review Gator is reviewing or awaiting PR review feedback state:accepted A maintainer decided OpenShell should pursue this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(k8s): support the additional destination CA with shared supervisors

1 participant