Files
webup-cloud/infra/k8s/sandbox-gateway.yaml
WebUp Cloud d1d14f0f77
Verify control plane / verify (push) Canceled after 0s
Verify control plane / verify (pull_request) Canceled after 0s
Publish AI workspace source through the isolated runtime
2026-11-08 17:29:54 +08:00

74 lines
2.5 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: sandbox-gateway
namespace: platform-sandboxes
spec:
replicas: 1
selector:
matchLabels: {platform/component: sandbox-gateway}
template:
metadata:
labels: {platform/component: sandbox-gateway}
spec:
serviceAccountName: sandbox-gateway
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
seccompProfile: {type: RuntimeDefault}
containers:
- name: gateway
# Build node-agent/Dockerfile, push to your registry and replace this image.
image: registry.example.invalid/platform/sandbox-gateway:0.2.0
ports: [{containerPort: 8090}]
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: {drop: [ALL]}
env:
- name: PYTHONDONTWRITEBYTECODE
value: '1'
- name: SANDBOX_TOKEN
valueFrom:
secretKeyRef: {name: sandbox-gateway, key: SANDBOX_TOKEN}
- name: SANDBOX_NAMESPACE
value: platform-sandboxes
- name: RUNTIME_TOKEN
valueFrom:
secretKeyRef: {name: sandbox-gateway, key: RUNTIME_TOKEN, optional: true}
- name: RUNTIME_NAMESPACE
value: platform-runtimes
- name: RUNTIME_TLS_ISSUER
valueFrom:
configMapKeyRef: {name: webup-runtime, key: TLS_ISSUER, optional: true}
- name: RUNTIME_INGRESS_CLASS
valueFrom:
configMapKeyRef: {name: webup-runtime, key: INGRESS_CLASS, optional: true}
- name: RUNTIME_SOURCE_IMAGE
valueFrom:
configMapKeyRef: {name: webup-runtime, key: SOURCE_IMAGE, optional: true}
- name: SANDBOX_IMAGE
value: registry.example.invalid/platform/development-sandbox:0.2.0
- name: SANDBOX_RUNTIME_CLASS
value: gvisor
resources:
requests: {cpu: 100m, memory: 128Mi}
limits: {cpu: '1', memory: 512Mi}
readinessProbe:
tcpSocket: {port: 8090}
initialDelaySeconds: 5
livenessProbe:
tcpSocket: {port: 8090}
initialDelaySeconds: 15
---
apiVersion: v1
kind: Service
metadata:
name: sandbox-gateway
namespace: platform-sandboxes
spec:
type: ClusterIP
selector: {platform/component: sandbox-gateway}
ports: [{port: 8090, targetPort: 8090}]