Skip to content

bug(kubernetes): support OpenShift user namespaces and per-sandbox Pod identities #5785

Open

Description

@dhirajsb

User Story

I want to run OpenShell Kubernetes sandboxes with Pod user namespaces on OpenShift. I also want to configure UID, GID, and filesystem group for an individual sandbox when its image or workspace volume requires specific IDs.

Problem Statement

OpenShell's Kubernetes driver sets hostUsers: false when the sandbox template enables user namespaces. Identity resolution still uses the driver-wide UID/GID configuration or OpenShift namespace annotations, independent of the user-namespace flag. The generated Pod also sets fsGroup from the sandbox GID and supplies supplementalGroups: []. OpenShell v0.1.9 identity resolution · Generated Pod security context

An OpenShift namespace UID/GID allocation can fall outside the in-Pod range for Kubernetes user namespaces. The sandbox create API also has no per-instance UID, GID, or fsGroup fields. OpenShell sandbox API · Kubernetes user namespaces

Reproduction

  1. Use the OpenShell Kubernetes driver on OpenShift with a sandbox service account eligible for the built-in restricted-v3 SCC.
  2. Enable user_namespaces in a sandbox template and leave the gateway-wide UID/GID settings unset.
  3. Inspect the generated Pod template for hostUsers: false, the selected UID/GID and fsGroup, and the supplemental groups list. Test admission with restricted-v3. OpenShift SCC documentation

Acceptance Criteria

  • OpenShell can start user-namespaced workload Pods with the built-in restricted-v3 SCC. Identity and group handling satisfy admission and preserve the gateway's post-admission security checks.
  • Operators can configure optional non-root UID, GID, and fsGroup for individual sandbox Pods using an authorized create or template path. Invalid IDs are rejected, and existing gateway defaults still work when the options are omitted.
  • Sandbox start and resume preserve the intended identity and workspace volume access. Tests cover OpenShift admission, distinct host mappings for two Pods, and retained volume access after resume.

Related work on namespace-scoped UID/GID defaults is tracked in #5494.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:triage-neededOpened without agent diagnostics and needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions