Files
OpenShell/deploy/helm/openshell/templates/networkpolicy.yaml
Dhiraj Bokde cc4ded2088 feat(helm): split gateway and workspace charts (#2643)
* feat(helm): split gateway and workspace charts

Signed-off-by: Dhiraj Bokde <dbokde@nvidia.com>

* fix(helm): preserve split chart upgrade compatibility

Keep workspace manifests valid after value validation and default legacy reused values to the combined resource topology.

* fix(ci): preserve VM runtime for E2E

The Rust cache restores target/ after VM runtime artifacts are staged,
overwriting target/vm-runtime-compressed before openshell-driver-vm is built.
Stage the compressed runtime outside target and pass that location through
OPENSHELL_VM_RUNTIME_COMPRESSED_DIR so build.rs can embed the supervisor.

Also locate the Helm split-ownership test repository root from the script
path rather than git rev-parse. The test runs in a container where the
GitHub checkout can be owned by a different UID and rejected as dubious
ownership.

Signed-off-by: Dhiraj Bokde <dbokde@nvidia.com>

* fix(ci): install yq for Helm ownership test

The split-chart ownership regression uses yq to inspect rendered YAML,
but the Helm CI container installs only tools declared in mise.
Declare and lock yq so mise install --locked provides the test dependency.

Signed-off-by: Dhiraj Bokde <dbokde@nvidia.com>

---------

Signed-off-by: Dhiraj Bokde <dbokde@nvidia.com>
2026-09-02 00:23:39 +00:00

36 lines
1.3 KiB
YAML

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
{{- if and (include "openshell.workspaceResourcesEnabled" .) .Values.networkPolicy.enabled }}
# NetworkPolicy restricting SSH ingress on sandbox pods to the gateway pod.
# Sandbox pods are dynamically created by the server and labelled with
# openshell.ai/managed-by=openshell. This policy ensures only the gateway
# (openshell server) pod can reach the sandbox SSH port (2222), blocking
# lateral movement from other in-cluster workloads.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "openshell.fullname" . }}-sandbox-ssh
namespace: {{ include "openshell.sandboxNamespace" . }}
labels:
{{- include "openshell.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
openshell.ai/managed-by: openshell
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ .Release.Namespace }}
podSelector:
matchLabels:
app.kubernetes.io/name: {{ include "openshell.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
ports:
- protocol: TCP
port: 2222
{{- end }}