Repository navigation
Conversation
…nces
Expose pod.image_pull_secrets in the per-sandbox Kubernetes driver
config: a caller selects existing Secret names (max 8, validated as
Kubernetes resource names) that the gateway admits by the same
workspace-label mechanism as caller PVCs, then appends to the workload
Pod's imagePullSecrets without duplicates. OpenShell references existing
Secrets only; it never uploads, creates, or copies them.
Opt-in lives on the Kubernetes driver's own config as
allow_driver_config_image_pull_secrets (standalone --allow-driver-config-image-pull-secrets),
keeping it out of the shared DriverAdmissionConfig since it is
Kubernetes-only. The driver fails closed at startup unless
allow_driver_config is set, resource_admission is enabled, and a required
label pins the caller workspace via ${workspace}; managed mode rejects
any caller selection with FailedPrecondition before a lookup.
Admission distinguishes caller from gateway-owned Secrets via a
driver-owned annotation, not the rendered names, so it composes with
managed mode's per-generation Secret copies. Gateway-wide names are
normalized once at init so trimmed rendered names match the exemption
set. The caller selection is recorded and re-gated on restart and
revalidation, suspending a sandbox whose Secret drifts or whose operator
later disables the flag.
Issue: ai-openshell#5113
Signed-off-by: Vasil Kurdov <vasil.kurdov@sap.com>
Gate the namespaced get secrets RBAC rule on both allowDriverConfig and allowDriverConfigImagePullSecrets in the openshell and openshell-workspace Role templates, mapping legacy camelCase to snake_case. Only write the snake_case driver key when the opt-in is on, so a newer chart rendering gateway.toml for a pinned older gateway image does not emit an unknown field. The gateway ClusterRole never grants get secrets: managed mode does not support caller selection and rejects it with FailedPrecondition. The RBAC rule grants get on all Secrets in the namespace (full data; Kubernetes RBAC cannot restrict it to metadata), so the values, README, and template comments describe the exposure and recommend a sandbox namespace separate from the gateway's own TLS and database Secrets. Issue: ai-openshell#5113 Signed-off-by: Vasil Kurdov <vasil.kurdov@sap.com>
Document the per-sandbox pod.image_pull_secrets interface: additive behavior alongside gateway-wide references, the two required opt-in flags, the approval and workspace-namespace requirements, and that the platform is responsible for provisioning the referenced Secrets. Spell out that the Secret get RBAC returns full Secret data (not metadata) and recommend a sandbox namespace separate from the gateway's own Secrets. Issue: ai-openshell#5113 Signed-off-by: Vasil Kurdov <vasil.kurdov@sap.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add per-sandbox, caller-selected image-pull Secret references for the Kubernetes compute driver. A caller passes
template.driver_config.kubernetes.pod.image_pull_secrets(up to 8 existing Secret names); the gateway admits each by the same workspace-label mechanism as caller PVCs and appends them to the workload Pod'simagePullSecrets. OpenShell references existing Secrets only — it never uploads, creates, or copies them. The feature is strictly opt-in and rejected in managed mode.Related Issue
Closes #5113
Changes
allow_driver_config_image_pull_secrets; standalone--allow-driver-config-image-pull-secrets) lives on the Kubernetes driver's own config, not the sharedDriverAdmissionConfig, since it is Kubernetes-only. The driver fails closed at startup (and in config preflight) unlessallow_driver_configis set,resource_admissionis enabled, and a required label pins the caller workspace via${workspace}. Caller vs gateway-owned Secrets are distinguished by the annotation, not the rendered names, so this composes with managed mode's per-generation Secret copies. Gateway-wide names are normalized once at init so trimmed rendered names match the admission exemption set.get secretsRBAC on both flags in theopenshellandopenshell-workspaceRole templates; write the snake_case driver key only when the opt-in is on; the gateway ClusterRole never grantsget secrets.getreturns full Secret data (recommend a sandbox namespace separate from the gateway's own Secrets).Reviewer notes:
DriverAdmissionConfig, so it does not touch the desktop driver crates frozen by ci: freeze desktop driver paths while they move to ai-openshell/desktop #6124. The trade-off: the gateway↔driver acknowledgement no longer cross-checks this specific flag, which is acceptable for a Kubernetes-only, in-gateway driver.is_kubernetes_resource_namealso relaxes PVCclaim_namevalidation (no per-segment 63-char cap) and adjusts its error text — correct per Kubernetes resource-name rules, but incidental to this feature.metadata_lookup_errorreturns a distinct "does not exist" message for a 404 vs a label-mismatch rejection (a low-severity name-existence oracle in shared namespaces, CWE-204). It predates this feature and serves PVC admission too; better addressed in a separate issue than by changing a shared diagnostic here.feat(driver-kubernetes),feat(helm),docs.Release Notes
The Kubernetes compute driver can now let sandbox callers select existing image-pull Secrets per request via
driver_config.kubernetes.pod.image_pull_secrets, gated behindallowDriverConfigand a newallowDriverConfigImagePullSecretsopt-in. Selections reference existing Secrets approved by workspace labels and are rejected in managed mode.Testing
Detail:
cargo fmt/cargo clippy(driver-kubernetes lib+tests) — cleancargo test -p openshell-driver-kubernetes --lib— 378 passed (image-pull suite incl. gate, preflight-gate regression, and name normalization)helm lint+helm unittestboth charts — 528 + 9 passedcheck_frozen_paths.py— no changes to frozen pathse2e/rust/e2e-kubernetes.shon an ephemeral k3d cluster): 80/80 conformance passed (0 skipped) + 39/39 driver-suite passed (2 env-gated skips); cluster torn down cleanly. Run against the pre-rebase tip; the feature commits replayed cleanly onto current main with no content change.Checklist