|
| 1 | +--- |
| 2 | +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | +title: "Kubernetes Sandbox Topology" |
| 5 | +sidebar-title: "Topology" |
| 6 | +description: "Review the default combined supervisor topology for Kubernetes sandbox pods." |
| 7 | +keywords: "Generative AI, Cybersecurity, Kubernetes, Sandboxing, RuntimeClass" |
| 8 | +position: 2 |
| 9 | +--- |
| 10 | + |
| 11 | +Kubernetes sandbox pods run the OpenShell supervisor in `combined` topology by |
| 12 | +default. Combined topology keeps network, filesystem, and process controls in |
| 13 | +the agent pod so the supervisor can enforce the complete OpenShell sandbox |
| 14 | +contract before launching the workload. |
| 15 | + |
| 16 | +## Choose a Topology |
| 17 | + |
| 18 | +The default `combined` topology preserves the full OpenShell enforcement model. |
| 19 | +Use it when you need OpenShell to apply all sandbox controls inside the workload |
| 20 | +pod and your cluster policy permits the required Linux capabilities. |
| 21 | + |
| 22 | +| Topology | Use when | Main tradeoff | |
| 23 | +|---|---|---| |
| 24 | +| `combined` | You need OpenShell network, filesystem, and process controls in the sandbox workload. | The agent container carries the Linux capabilities the supervisor needs. | |
| 25 | + |
| 26 | +Additional Kubernetes sandbox topologies are still being designed. Until they |
| 27 | +are documented as supported configuration values, `combined` is the only |
| 28 | +supported value for `supervisor.topology`. |
| 29 | + |
| 30 | +## Privilege Model |
| 31 | + |
| 32 | +The long-running container permissions for `combined` topology are: |
| 33 | + |
| 34 | +| Topology | Pod or container | UID/GID | Privilege escalation | Capabilities | Result | |
| 35 | +|---|---|---|---|---|---| |
| 36 | +| `combined` | Agent container, which also runs the supervisor | Not forced by topology | Not explicitly disabled by the driver | Adds `SYS_ADMIN`, `NET_ADMIN`, `SYS_PTRACE`, and `SYSLOG`; adds `SETUID`, `SETGID`, and `DAC_READ_SEARCH` when user namespaces are enabled | Full supervisor controls run in the agent container. | |
| 37 | + |
| 38 | +Short-lived setup containers still have the permissions needed to prepare the |
| 39 | +pod: |
| 40 | + |
| 41 | +| Topology | Setup container | UID/GID | Privilege escalation | Capabilities | Purpose | |
| 42 | +|---|---|---|---|---|---| |
| 43 | +| `combined` | Supervisor install init container | `0` | Not set | Not set | Copies the supervisor binary into the agent container volume. | |
| 44 | + |
| 45 | +## Combined Topology |
| 46 | + |
| 47 | +Combined topology is the original Kubernetes mode and remains the default. The |
| 48 | +agent container starts the OpenShell supervisor, and the supervisor launches the |
| 49 | +workload after applying sandbox setup. |
| 50 | + |
| 51 | +Combined topology keeps these controls in one supervisor path: |
| 52 | + |
| 53 | +- Network endpoint and L7 policy enforcement. |
| 54 | +- Filesystem policy enforcement. |
| 55 | +- Process and binary identity checks. |
| 56 | +- Privilege drop into the sandbox user. |
| 57 | +- Gateway relay, SSH sessions, exec, and file sync. |
| 58 | + |
| 59 | +Because the supervisor performs network namespace setup and process/filesystem |
| 60 | +controls from the agent container, Kubernetes grants that container elevated |
| 61 | +Linux capabilities. Use this mode when you need the complete OpenShell sandbox |
| 62 | +contract and your cluster policy permits those capabilities. |
| 63 | + |
| 64 | +## RuntimeClass Isolation |
| 65 | + |
| 66 | +RuntimeClass isolation can add a stronger container boundary for the sandbox |
| 67 | +workload when the cluster supports it. Runtime classes do not replace the |
| 68 | +combined topology's supervisor controls; they add another isolation boundary |
| 69 | +around the same supervised workload. |
| 70 | + |
| 71 | +You can set a default runtime class in the Kubernetes driver configuration or |
| 72 | +override it per sandbox with driver config: |
| 73 | + |
| 74 | +```shell |
| 75 | +openshell sandbox create \ |
| 76 | + --driver-config-json '{"kubernetes":{"pod":{"runtime_class_name":"kata-containers"}}}' \ |
| 77 | + -- claude |
| 78 | +``` |
| 79 | + |
| 80 | +## Configure Combined Mode |
| 81 | + |
| 82 | +For direct gateway TOML configuration, leave `supervisor_topology` unset, or |
| 83 | +set it to `combined`, to use the default single-container supervisor path: |
| 84 | + |
| 85 | +```toml |
| 86 | +[openshell.drivers.kubernetes] |
| 87 | +supervisor_topology = "combined" |
| 88 | +``` |
| 89 | + |
| 90 | +When the Helm chart renders `gateway.toml`, leave `supervisor.topology` unset, |
| 91 | +or set it to `combined`, to produce the same driver configuration: |
| 92 | + |
| 93 | +```yaml |
| 94 | +supervisor: |
| 95 | + topology: combined |
| 96 | +``` |
| 97 | +
|
| 98 | +## Next Steps |
| 99 | +
|
| 100 | +- To install OpenShell on Kubernetes, refer to [Setup](/kubernetes/setup). |
| 101 | +- To configure gateway authentication, refer to [Access Control](/kubernetes/access-control). |
| 102 | +- To review the driver fields, refer to [Gateway Configuration File](/reference/gateway-config). |
0 commit comments