Repository navigation
feat(k8s): support the additional destination CA with shared supervisors - #6080
Gal-Zaidman wants to merge 1 commit into
Conversation
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>
BlockedGitHub reports merge conflicts with Action required: @Gal-Zaidman, please update the PR branch against Gator metadata
|
1984da4 to
0b045b1
Compare
There was a problem hiding this comment.
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:e2eapplies 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; |
There was a problem hiding this comment.
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 beforeSharedSupervision::launchpersists the Secret or assigns the generation.
| provisioned.runtime_descriptor, | ||
| launch_authentication, | ||
| proxy_ca, | ||
| self.network_trust_bundle.as_ref(), |
There was a problem hiding this comment.
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_innerand 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.
Summary
A gateway with the shared Kubernetes supervisor topology now accepts
[openshell.supervisor.network] additional_ca_bundleinstead 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
additional-ca.pem, mode 0600) and passes it to the network supervisor.additional_cae2e test runs against shared supervisors with the newmise run e2e:kubernetes:additional-ca-sharedtask.debug-openshell-clusterskill describe the shared-topology delivery, its size limit, and the supervisor upgrade order.Release Notes
additional_ca_bundlenow works with shared Kubernetes supervisors. Upgrade the shared supervisors before configuring it.Testing
cargo fmt, clippy with-D warningson the affected crates and the e2e crate, unit tests for the Kubernetes driver, supervisor-control, supervisor, and gateway, andmise run helm:testmise run e2e:kubernetes:additional-ca-sharedpassed 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