v0.2 - Real Workspaces: - Project-specific claudebox StatefulSets (pantheon, aeries) - Init containers for git clone via SSH - Deploy key secrets template - Project ConfigMaps for CLAUDE.md v0.3 - Git Integration: - Dockerfile with rdev-bot git identity - openssh-client for SSH operations - Image version bump to v0.3.0 v0.4 - API Server: - Go REST API with chi router - Endpoints: /projects, /claude, /shell, /git, /events - SSE streaming for real-time output - OpenAPI docs via Scalar at /docs - Kubernetes RBAC for pod exec - Executor and project registry packages Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
161 lines
4.3 KiB
YAML
161 lines
4.3 KiB
YAML
# claudebox-aeries - Claude Code pod for the Aeries project
|
|
# v0.2 - Real workspace with init container repo clone
|
|
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: claudebox-aeries
|
|
namespace: rdev
|
|
labels:
|
|
app.kubernetes.io/name: claudebox-aeries
|
|
app.kubernetes.io/part-of: rdev
|
|
rdev.orchard9.ai/project: aeries
|
|
spec:
|
|
serviceName: claudebox-aeries
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: claudebox-aeries
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: claudebox-aeries
|
|
app.kubernetes.io/name: claudebox-aeries
|
|
app.kubernetes.io/part-of: rdev
|
|
rdev.orchard9.ai/project: aeries
|
|
spec:
|
|
# Init container clones repo if workspace is empty
|
|
initContainers:
|
|
- name: git-clone
|
|
image: ghcr.io/orchard9/rdev-claudebox:v0.3.0
|
|
command:
|
|
- /bin/bash
|
|
- -c
|
|
- |
|
|
set -e
|
|
|
|
# Setup SSH for GitHub
|
|
mkdir -p /root/.ssh
|
|
cp /ssh-keys/id_ed25519 /root/.ssh/id_ed25519
|
|
chmod 600 /root/.ssh/id_ed25519
|
|
cp /ssh-keys/known_hosts /root/.ssh/known_hosts
|
|
chmod 644 /root/.ssh/known_hosts
|
|
|
|
# Clone or fetch
|
|
if [ ! -d /workspace/.git ]; then
|
|
echo "Cloning aeries repository..."
|
|
git clone git@github.com:orchard9/aeries.git /workspace
|
|
echo "Clone complete."
|
|
else
|
|
echo "Repository exists, fetching latest..."
|
|
cd /workspace
|
|
git fetch origin
|
|
echo "Fetch complete."
|
|
fi
|
|
|
|
# Show status
|
|
cd /workspace
|
|
git log -1 --oneline
|
|
volumeMounts:
|
|
- name: workspace
|
|
mountPath: /workspace
|
|
- name: ssh-keys
|
|
mountPath: /ssh-keys
|
|
readOnly: true
|
|
|
|
containers:
|
|
- name: claudebox
|
|
image: ghcr.io/orchard9/rdev-claudebox:v0.3.0
|
|
imagePullPolicy: Always
|
|
|
|
resources:
|
|
requests:
|
|
cpu: "500m"
|
|
memory: "1Gi"
|
|
limits:
|
|
cpu: "2"
|
|
memory: "4Gi"
|
|
|
|
volumeMounts:
|
|
# Workspace with cloned repo
|
|
- name: workspace
|
|
mountPath: /workspace
|
|
|
|
# Claude config directory (persistent for auth)
|
|
- name: claude-config
|
|
mountPath: /root/.claude
|
|
|
|
# SSH keys for git operations
|
|
- name: ssh-keys
|
|
mountPath: /root/.ssh
|
|
readOnly: true
|
|
|
|
# Project-specific CLAUDE.md
|
|
- name: project-config
|
|
mountPath: /workspace/CLAUDE.md
|
|
subPath: CLAUDE.md
|
|
|
|
# Simple liveness check - container is running
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- cat
|
|
- /healthcheck.sh
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 60
|
|
|
|
# Readiness - claude CLI is available
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- claude
|
|
- --version
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 30
|
|
timeoutSeconds: 10
|
|
|
|
volumes:
|
|
- name: workspace
|
|
persistentVolumeClaim:
|
|
claimName: claudebox-aeries-workspace
|
|
|
|
- name: claude-config
|
|
persistentVolumeClaim:
|
|
claimName: claudebox-aeries-claude-config
|
|
|
|
- name: ssh-keys
|
|
secret:
|
|
secretName: github-deploy-key-aeries
|
|
defaultMode: 0600
|
|
items:
|
|
- key: id_ed25519
|
|
path: id_ed25519
|
|
- key: known_hosts
|
|
path: known_hosts
|
|
|
|
- name: project-config
|
|
configMap:
|
|
name: claudebox-aeries-config
|
|
|
|
# Pull from GitHub Container Registry
|
|
imagePullSecrets:
|
|
- name: ghcr-secret
|
|
---
|
|
# Headless service for StatefulSet
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: claudebox-aeries
|
|
namespace: rdev
|
|
labels:
|
|
app.kubernetes.io/name: claudebox-aeries
|
|
app.kubernetes.io/part-of: rdev
|
|
rdev.orchard9.ai/project: aeries
|
|
spec:
|
|
clusterIP: None
|
|
selector:
|
|
app: claudebox-aeries
|
|
ports:
|
|
- port: 8080
|
|
name: http
|