Files
2026-09-17 19:36:19 +00:00

63 lines
1.8 KiB
YAML

{{- $workspaceMode := .Values.server.drivers.kubernetes.workspaceMode | default "shared" -}}
{{- if and (eq $workspaceMode "shared") (include "openshell.workspaceResourcesEnabled" .) }}
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "openshell.fullname" . }}-sandbox
namespace: {{ include "openshell.sandboxNamespace" . }}
labels:
{{- include "openshell.labels" . | nindent 4 }}
rules:
- apiGroups:
- agents.x-k8s.io
resources:
- sandboxes
- sandboxes/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- get
- list
- watch
# Per-sandbox identity: TokenReview authenticates the projected token from
# the configured sandbox service account, then the gateway resolves the
# returned pod name and UID to its immutable sandbox labels. The driver also
# creates and deletes the directly managed supervisor Pod. PATCH removes the
# driver-owned bootstrap scheduling gate after immutable bootstrap material
# has been created.
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- patch
- watch
- apiGroups: [""]
resources: ["services"]
verbs: ["create", "get"]
- apiGroups: [""]
resources: ["secrets"]
# Bootstrap Secrets are generation-scoped. Recovery lists them by label and
# deletes stale generations with UID preconditions before retrying creation.
verbs: ["create", "list", "delete"]
- apiGroups: ["networking.k8s.io"]
resources: ["networkpolicies"]
verbs: ["create", "get"]
{{- end }}