sandbox connected and streaming
This commit is contained in:
@@ -60,10 +60,10 @@ All resources follow a consistent naming pattern based on `userId`:
|
||||
```typescript
|
||||
userId: "user-abc123"
|
||||
↓
|
||||
deploymentName: "agent-user-abc123"
|
||||
serviceName: "agent-user-abc123"
|
||||
pvcName: "agent-user-abc123-data"
|
||||
mcpEndpoint: "http://agent-user-abc123.dexorder-agents.svc.cluster.local:3000"
|
||||
deploymentName: "sandbox-user-abc123"
|
||||
serviceName: "sandbox-user-abc123"
|
||||
pvcName: "sandbox-user-abc123-data"
|
||||
mcpEndpoint: "http://sandbox-user-abc123.dexorder-sandboxes.svc.cluster.local:3000"
|
||||
```
|
||||
|
||||
User IDs are sanitized to be Kubernetes-compliant (lowercase alphanumeric + hyphens).
|
||||
@@ -82,7 +82,7 @@ Templates use simple string replacement:
|
||||
- `{{deploymentName}}` - Computed deployment name
|
||||
- `{{serviceName}}` - Computed service name
|
||||
- `{{pvcName}}` - Computed PVC name
|
||||
- `{{agentImage}}` - Agent container image (from env)
|
||||
- `{{sandboxImage}}` - Agent container image (from env)
|
||||
- `{{sidecarImage}}` - Lifecycle sidecar image (from env)
|
||||
- `{{storageClass}}` - Kubernetes storage class (from env)
|
||||
|
||||
@@ -145,16 +145,16 @@ Environment variables:
|
||||
|
||||
```bash
|
||||
# Kubernetes
|
||||
KUBERNETES_NAMESPACE=dexorder-agents
|
||||
KUBERNETES_NAMESPACE=dexorder-sandboxes
|
||||
KUBERNETES_IN_CLUSTER=true # false for local dev
|
||||
KUBERNETES_CONTEXT=minikube # for local dev only
|
||||
|
||||
# Container images
|
||||
AGENT_IMAGE=ghcr.io/dexorder/agent:latest
|
||||
SANDBOX_IMAGE=ghcr.io/dexorder/sandbox:latest
|
||||
SIDECAR_IMAGE=ghcr.io/dexorder/lifecycle-sidecar:latest
|
||||
|
||||
# Storage
|
||||
AGENT_STORAGE_CLASS=standard
|
||||
SANDBOX_STORAGE_CLASS=standard
|
||||
```
|
||||
|
||||
## Security
|
||||
@@ -162,9 +162,9 @@ AGENT_STORAGE_CLASS=standard
|
||||
The gateway uses a restricted ServiceAccount with RBAC:
|
||||
|
||||
**Can do:**
|
||||
- ✅ Create deployments in `dexorder-agents` namespace
|
||||
- ✅ Create services in `dexorder-agents` namespace
|
||||
- ✅ Create PVCs in `dexorder-agents` namespace
|
||||
- ✅ Create deployments in `dexorder-sandboxes` namespace
|
||||
- ✅ Create services in `dexorder-sandboxes` namespace
|
||||
- ✅ Create PVCs in `dexorder-sandboxes` namespace
|
||||
- ✅ Read pod status and logs (debugging)
|
||||
- ✅ Update deployments (future: resource scaling)
|
||||
|
||||
@@ -226,7 +226,7 @@ kubectl apply -k deploy/k8s/dev
|
||||
# .env
|
||||
KUBERNETES_IN_CLUSTER=false
|
||||
KUBERNETES_CONTEXT=minikube
|
||||
KUBERNETES_NAMESPACE=dexorder-agents
|
||||
KUBERNETES_NAMESPACE=dexorder-sandboxes
|
||||
```
|
||||
|
||||
4. Run gateway:
|
||||
@@ -242,9 +242,9 @@ wscat -c "ws://localhost:3000/ws/chat" -H "Authorization: Bearer your-jwt"
|
||||
|
||||
The gateway will create deployments in minikube. View with:
|
||||
```bash
|
||||
kubectl get deployments -n dexorder-agents
|
||||
kubectl get pods -n dexorder-agents
|
||||
kubectl logs -n dexorder-agents agent-user-abc123 -c agent
|
||||
kubectl get deployments -n dexorder-sandboxes
|
||||
kubectl get pods -n dexorder-sandboxes
|
||||
kubectl logs -n dexorder-sandboxes sandbox-user-abc123 -c agent
|
||||
```
|
||||
|
||||
## Production Deployment
|
||||
@@ -262,7 +262,7 @@ kubectl apply -k deploy/k8s/prod
|
||||
```
|
||||
|
||||
3. Gateway runs in `dexorder-system` namespace
|
||||
4. Creates agent containers in `dexorder-agents` namespace
|
||||
4. Creates agent containers in `dexorder-sandboxes` namespace
|
||||
5. Admission policies enforce image allowlist and security constraints
|
||||
|
||||
## Monitoring
|
||||
|
||||
Reference in New Issue
Block a user