packages/plugins/sandbox-providers/kubernetes/SMOKE.md
@paperclipai/plugin-kubernetesManual sanity check that the plugin works end-to-end against a real paperclip-server instance and a real Kubernetes cluster (kind for local dev). Future work may automate this in CI.
kind create cluster --name paperclip
kubectl --context kind-paperclip get nodes returns a node in Ready state.cd packages/plugins/sandbox-providers/kubernetes
pnpm install --ignore-workspace
pnpm build
Expected: dist/ populated with compiled .js and .d.ts files. No errors.
In a separate terminal:
cd /path/to/paperclip
export PAPERCLIP_HOME=/tmp/paperclip-smoke
export PAPERCLIP_INSTANCE_ID=smoke
export PAPERCLIP_DEPLOYMENT_MODE=local_trusted
pnpm --filter @paperclipai/server dev
Wait for Server listening on 127.0.0.1:3100.
pnpm paperclipai plugin install \
--local /path/to/paperclip/packages/plugins/sandbox-providers/kubernetes \
--api-base http://127.0.0.1:3100
Expected: ✓ Installed paperclip.kubernetes-sandbox-provider v0.1.0 (ready).
CO_ID=$(curl -s -X POST -H "Content-Type: application/json" \
-d '{"name":"SmokeCo"}' \
http://127.0.0.1:3100/api/companies | jq -r '.id')
KUBECONFIG_CONTENT=$(cat ~/.kube/config | jq -Rs .)
curl -s -X POST -H "Content-Type: application/json" \
-d "{
\"name\": \"k8s-sandbox\",
\"driver\": \"sandbox\",
\"config\": {
\"provider\": \"kubernetes\",
\"kubeconfig\": $KUBECONFIG_CONTENT,
\"companySlug\": \"smoke\",
\"adapterType\": \"claude_local\",
\"imageAllowList\": [\"ghcr.io/paperclipai/agent-runtime-claude:v1\"]
}
}" \
http://127.0.0.1:3100/api/companies/$CO_ID/environments | jq
Expected: HTTP 201 with the new environment row.
ENV_ID=$(curl -s http://127.0.0.1:3100/api/companies/$CO_ID/environments | jq -r '.[0].id')
curl -s -X POST -d '{}' -H "Content-Type: application/json" \
http://127.0.0.1:3100/api/environments/$ENV_ID/probe | jq
Expected: {"ok": true, ...} with a summary mentioning the tenant namespace
(paperclip-smoke). On first probe the namespace may not yet exist —
the plugin treats a 404 on listNamespacedPod as a successful reachability
check.
Use the UI or the API to dispatch a run against the k8s-sandbox environment.
The plugin's onEnvironmentAcquireLease will:
ensureTenant — provision the paperclip-smoke namespace, SA, Role,
RoleBinding, ResourceQuota, LimitRange, NetworkPoliciesbuildJobManifest — render the security-hardened Job manifestcreateJob — submit to batch/v1createPerRunSecret — owned by the Job for cascade-deletekubectl --context kind-paperclip get namespace paperclip-smoke
kubectl --context kind-paperclip get all,networkpolicy,resourcequota,limitrange,sa,role,rolebinding -n paperclip-smoke
Expected:
paperclip-smoke exists with PSS labels
(pod-security.kubernetes.io/enforce=restricted)paperclip-tenant-sapaperclip-tenant-role, RoleBinding paperclip-tenant-rbpaperclip-quota, LimitRange paperclip-limitspaperclip-deny-all + paperclip-egress-allowpc-{ulid} and its child Podpc-{ulid}-env with ownerReferences pointing at the Jobkubectl --context kind-paperclip delete namespace paperclip-smoke
kill %1 # paperclip-server
In the PR description (or appended to this file as a dated section), record:
kubectl version server versionkubectl get all -n paperclip-smoke after step 6