Skip to content

feat(helm): split gateway and workspace namespace charts #2485

Closed

Description

@dhirajsb

Problem Statement

OpenShell now supports three Kubernetes workspace namespace modes through RFC
0011 and #2656:

  • shared: all workspaces use one configured namespace;
  • managed: the gateway creates and deletes a namespace per workspace; and
  • operator: each workspace maps to a pre-provisioned namespace discovered by
    label selector or allowlist file.

The remaining gap is Helm packaging and lifecycle ownership. The repository
still publishes one deploy/helm/openshell chart that combines the gateway
control plane with namespace-local sandbox prerequisites. Platform operators
therefore cannot install and upgrade one shared gateway independently from the
sandbox ServiceAccount, Role, RoleBinding, and NetworkPolicy owned by each
pre-provisioned application or tenant namespace.

This makes delegated workspace onboarding and GitOps ownership harder even
though the runtime can now map workspaces to multiple operator-managed
namespaces.

Proposed Design

Provide two independently installable and version-aligned charts while keeping
the current combined installation backward compatible:

  1. Gateway chart (helm-chart)
    • Continue to deploy the gateway workload, Service, configuration,
      PKI/database hooks, gateway ServiceAccount, and required cluster-scoped
      runtime permissions.
    • Add a backward-compatible value such as
      workspaceResources.enabled=false that omits resources owned by a
      workspace namespace.
    • Keep the existing default (true) so current installations render the
      same topology.
  2. Workspace chart (openshell-workspace)
    • Install once in each platform-managed application or tenant namespace.
    • Create only the sandbox ServiceAccount, namespaced Role and RoleBinding,
      and namespace-local sandbox SSH NetworkPolicy.
    • Accept the shared gateway ServiceAccount name and namespace explicitly so
      a RoleBinding can authorize a subject from another namespace.
    • Never create a namespace, gateway workload, or cluster-scoped resource.
  3. Release and documentation contract
    • Publish both OCI charts at the same OpenShell chart version.
    • Document one external namespace with shared mode and multiple
      pre-provisioned namespaces with operator mode.
    • Keep sandbox ServiceAccount naming aligned between the gateway and
      workspace releases.

Acceptance Criteria

  • Default gateway-chart renders retain the current object identities and
    combined-install behavior.
  • Gateway-only mode omits exactly the sandbox ServiceAccount, namespaced Role,
    RoleBinding, and NetworkPolicy.
  • The workspace chart renders those four namespace-local resources and no
    gateway or cluster-scoped resource.
  • A workspace RoleBinding can reference a gateway ServiceAccount in another
    namespace.
  • Automated render tests prove the gateway-only and workspace releases do not
    claim the same Kubernetes object.
  • Helm lint, generated documentation, unit tests, and OCI packaging cover both
    charts.

Scope Boundary

This RFE defines the chart and release ownership boundary. It does not change
Kubernetes driver namespace selection, operator allowlist behavior, namespace
lifecycle, or the cluster-wide watch/RBAC currently required by multi-namespace
runtime modes. Any redesign that replaces cluster-wide watches or further
attenuates operator-mode ClusterRole permissions should remain a separate
runtime/RBAC change.

Alternatives Considered

  • Install the gateway chart once per namespace: duplicates gateways,
    credentials, database state, and lifecycle operations.
  • Use only conditionals in one chart: can alter a render but does not provide
    an independently versioned tenant-onboarding artifact or clear GitOps
    ownership boundary.
  • Use managed mode for all tenants: lets the gateway create namespaces and
    prerequisites dynamically, but conflicts with platforms where namespace
    lifecycle and policy must remain operator-owned.

Current Upstream Findings

  • deploy/helm/openshell remains the only published chart.
  • server.drivers.kubernetes.workspaceMode now supports shared, managed,
    and operator; feat(k8s): add namespace-per-workspace support (RFC 0011 Phase 3) #2656 delivered namespace-per-workspace runtime support.
  • Shared mode renders a namespaced Role and RoleBinding. Managed/operator modes
    use the current ClusterRole model for multi-namespace access.
  • The chart still owns the sandbox ServiceAccount and NetworkPolicy alongside
    the gateway release.
  • RFC 0011 defines runtime namespace mapping, but not a separately published
    workspace chart or its release/ownership contract.

Implementation

PR #2643 implements this packaging boundary and preserves the current runtime
authorization model.

Checklist

Activity

  1. dhirajsb commented on Jul 27, 2026

    @dhirajsb
    ContributorAuthor

    📋 triage-agent

    Triage Assessment

    Classification: feature-valid

    Summary

    The deployment limitation is confirmed and the proposed packaging boundary is
    feasible. The current chart owns the gateway together with the sandbox
    ServiceAccount, Role, RoleBinding, and NetworkPolicy; Kubernetes supports a
    namespaced RoleBinding whose subject is the gateway ServiceAccount in another
    namespace.

    Investigation

    deploy/helm/openshell is the only chart. Its templates render workspace
    prerequisites into server.sandboxNamespace, while the gateway workload and
    cluster-scoped resources remain part of the same release. No focused
    duplicate was found. RFC 0011 describes multi-namespace runtime behavior but
    does not define a split Helm packaging and release contract.

    Recommendation

    Proceed with a backward-compatible gateway-only switch in the existing chart
    and an independently installable workspace chart. Maintainers should confirm
    chart naming, OCI publication, and long-term compatibility behavior before
    implementation.

  2. dhirajsb commented on Jul 27, 2026

    @dhirajsb
    ContributorAuthor

    I am happy to contribute the implementation for this feature rather than leaving it as a request for another contributor.

    I have a working experimental implementation on my fork: https://github.com/dhirajsb/OpenShell/tree/codex/split-helm-charts

    The spike adds an independently installable openshell-workspace chart and a backward-compatible switch that lets the existing chart deploy the gateway without workspace-owned resources. It also updates chart tests, documentation, and OCI release packaging. The Helm lint and unit-test suites pass locally.

    If maintainers agree with the proposed chart boundary, naming, and compatibility approach, I can rebase the branch onto current main, incorporate the requested direction, and submit the PR with this issue linked.

  3. dhirajsb commented on Aug 4, 2026

    @dhirajsb
    ContributorAuthor

    @NVIDIA/openshell-codeowners, could you please help with triage on this proposal?

    Does splitting the gateway-owned and workspace-namespace Helm resources sound useful for the supported Kubernetes deployment model? If so, would you be comfortable moving this through validation/acceptance and approving me to contribute the implementation as a PR?

    I have an experimental, tested branch linked above. I am happy to adjust the chart boundary, naming, and compatibility approach first. If the Kubernetes Operator work in #1719 or another issue/PR already owns this packaging boundary, please point me to it so I can avoid duplicating work.

  4. johntmyers commented on Aug 28, 2026

    @johntmyers
    Collaborator

    @dhirajsb if you want to clean up the PR and move it to ready we can take a look

  5. dhirajsb commented on Aug 28, 2026

    @dhirajsb
    ContributorAuthor

    Thanks @johntmyers. I rebased #2643 onto current main, resolved the chart drift, updated the documentation for the now-available operator workspace mode, added a cross-chart ownership render test, and marked the PR ready for review.

    Local validation passes: mise run pre-commit, all current Helm lint variants, 111 gateway chart tests, 4 workspace chart tests, disjoint gateway/workspace object ownership, and OCI packaging for both charts.

  6. removed
    state:triage-neededOpened without agent diagnostics and needs triage
    on Oct 1, 2026
  7. dhirajsb commented on Oct 13, 2026

    @dhirajsb
    ContributorAuthor

    Validated #2643 against the packaging requirements. The default gateway render retains all 15 object identities. Gateway-only mode removes exactly the sandbox ServiceAccount, Role, RoleBinding, and NetworkPolicy; the workspace chart renders those four resources and supports a gateway ServiceAccount in another namespace.

    Fresh validation passed all 123 Helm tests, lint, packaging, and the disjoint-ownership check. Both OCI charts are available at version 0.1.3. This satisfies the chart-split request; the existing multi-namespace runtime/RBAC model remains a separate concern.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions