Skip to content

Secure, Fast, and Extensible Sandbox runtime for AI agents.

2.1 KB
Raw Blame
# Copyright 2026 The OpenSandbox Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Read access to pods/services and BatchSandboxes so the gateway can resolve
# sandbox endpoints in the dataplane namespace.
{{- if .Values.rbac.create }}
---
apiVersion: {{ include "opensandbox-ingress-gateway.rbac.apiVersion" . }}
kind: ClusterRole
metadata:
  name: {{ include "opensandbox-ingress-gateway.roleName" . }}
  labels:
    {{- include "opensandbox-ingress-gateway.labels" . | nindent 4 }}
rules:
  - apiGroups: [""]
    resources: ["pods", "pods/status", "services"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["sandbox.opensandbox.io"]
    resources: ["batchsandboxes", "batchsandboxes/status"]
    verbs: ["get", "list", "watch"]
  {{- if .Values.gateway.wake.enabled }}
  # OSEP-0024 wake gating: read-only access to the fast-sandbox Sandbox CR
  # so the gateway can check the per-sandbox idle policy before waking it.
  - apiGroups: ["sandbox.fast.io"]
    resources: ["sandboxes"]
    verbs: ["get"]
  {{- end }}
---
apiVersion: {{ include "opensandbox-ingress-gateway.rbac.apiVersion" . }}
kind: ClusterRoleBinding
metadata:
  name: {{ include "opensandbox-ingress-gateway.roleName" . }}
  labels:
    {{- include "opensandbox-ingress-gateway.labels" . | nindent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ include "opensandbox-ingress-gateway.roleName" . }}
subjects:
  - kind: ServiceAccount
    name: {{ include "opensandbox-ingress-gateway.serviceAccountName" . }}
    namespace: {{ include "opensandbox-ingress-gateway.namespace" . }}
{{- end }}