Harnessing OpenShell on Kubernetes: A Platform Engineer's Guide
OpenShell exists to address the growing need for secure and isolated environments for running agents on Kubernetes. As a CNCF Sandbox project initiated by NVIDIA, it allows platform engineers to deploy agents safely, ensuring that workloads do not compromise cluster security. By leveraging the Agent Sandbox resource, OpenShell transforms each sandbox into a Pod, which is crucial for maintaining a controlled execution environment.
The mechanism behind OpenShell involves a gateway that manages every sandbox. When a request is made, the gateway authenticates the caller, resolves necessary parameters like image and policy, and rejects any unsafe configurations. It creates two NetworkPolicies: one for workload Pods, restricting all outbound traffic and allowing inbound traffic only from supervisors on TCP 5500, and another for supervisor Pods. The Sandbox resource is created in a suspended state, and a PVC for /sandbox is established. The supervisor Pod connects to the gateway with a unique identity, ensuring that all outbound requests from the agent are validated before establishing upstream connections.
In production, you need to prepare your cluster by installing a CNI that enforces ingress and egress NetworkPolicies, such as Cilium. Note that currently, OpenShell sandboxes can only be created through the Gateway API, not the Kubernetes API. This could limit flexibility in larger environments, especially since each agent requires a dedicated Supervisor Pod for isolation, which may not scale well. Keep an eye on the roadmap for more flexible deployment options as they develop.
Key takeaways
- →Understand that OpenShell is a runtime for safely running agents on Kubernetes.
- →Utilize the Agent Sandbox resource to manage workloads securely.
- →Implement strict NetworkPolicies to control traffic between Pods.
- →Prepare your cluster with a suitable CNI like Cilium for effective policy enforcement.
- →Be aware that sandboxes can only be created via the Gateway API, limiting integration options.
Why it matters
In production, the ability to run agents securely is paramount. OpenShell's strict isolation and network policies help prevent potential vulnerabilities that can arise from untrusted workloads.
Code examples
openshell sandbox create –workspace demo –name policy-demo –from nicolaka/netshoot@sha256:… –no-auto-providersWhen NOT to use this
The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.
Want the complete reference?
Read official docsIndustry-standard certifications built by the people behind Linux and Kubernetes. Earn the CKA — the gold standard Kubernetes administrator cert. OpsCanary readers get 30% off year-round with code OPSCANARY3.
Get CKA certified →AWS Nitro Sandboxes: Elevating Pod Security in EKS
AWS Nitro Sandboxes provide a powerful solution for workload isolation in Amazon EKS, giving each pod a hardware-enforced security boundary. This ensures that even if one pod is compromised, it cannot affect others or the host system.
Harnessing OpenShell on Kubernetes: A Practical Guide for Platform Engineers
OpenShell offers a secure runtime for agents in Kubernetes, addressing the need for safe agent execution. With its unique Agent Sandbox resource, you can manage network access and policy checks effectively. Dive in to discover how to implement this in your cluster.
OpenKruise Agents v0.6.0: Elevating Sandbox Security and Automation
OpenKruise Agents v0.6.0 brings significant advancements in managing agent sandboxes on Kubernetes. With features like two-stage traffic takeover and enhanced security profiles, it addresses critical challenges in application automation. Dive into how these components work together to secure your workloads.
Get the daily digest
One email. 5 articles. Every morning.
No spam. Unsubscribe anytime.