11. Onboard a local Kubernetes cluster with kind
This lesson tests three distinct things: recorded scoring, a real sandboxed CLI agent, and a streamed fake-model tool loop on distributed workers. It uses no provider credential. Complete the local mock-tool lesson first, so cluster setup cannot hide a broken SDK installation.
Check native tools and Docker
Section titled “Check native tools and Docker”You need Docker, kind, kubectl and Helm. On macOS, an executable in /usr/local/bin
can still be a Linux binary; inspect it if it fails with cannot execute binary file. Use a native installation rather than replacing unrelated machine tools.
docker infokind versionkubectl version --clienthelm version --shortStart Docker Desktop if needed. Do not prune images, delete existing clusters, or run the repository’s complete kind e2e script merely to follow this lesson: that script also does air-gap, multi-replica and restricted-namespace testing, and includes broad Docker-cache cleanup.
Build matching components and isolate the cluster
Section titled “Build matching components and isolate the cluster”Run from the repository root. Use a new cluster name. A separate kubeconfig avoids switching the current context of an existing cluster.
docker build --build-arg VERSION=0.3.1.dev0 -t evalsi:onboarding .export CLUSTER=evalsi-onboardingexport KUBECONFIG="$(mktemp)"export CONTEXT="kind-$CLUSTER"kind create cluster --name "$CLUSTER" --kubeconfig "$KUBECONFIG" --wait 180skind load docker-image evalsi:onboarding --name "$CLUSTER"kubectl --context "$CONTEXT" get nodesThe image bundles the Go server, guest, operator, Python worker and harness.
Stamping VERSION makes evalsi doctor able to compare matching versions.
Without stamping, the development Dockerfile reports server 0.0.0-dev beside
SDK 0.3.1.dev0; strict doctor refuses that mismatch even if a sandbox works.
Install the charts
Section titled “Install the charts”Create the namespace before installing the CRD chart: that chart writes the operator webhook certificate Secret there.
kubectl --context "$CONTEXT" create namespace onboardinghelm install onboarding-crds deploy/helm/evalsi-crds \ --kube-context "$CONTEXT" \ --set operator.namespace=onboarding --set operator.fullname=onboarding-evalsihelm install onboarding deploy/helm/evalsi \ --kube-context "$CONTEXT" -n onboarding \ -f examples/first-time-onboarding/kind-values.yaml --wait --timeout 5mkubectl --context "$CONTEXT" rollout status deployment/onboarding-evalsi \ -n onboarding --timeout=180skubectl --context "$CONTEXT" get pods,pvc -n onboardingThe values enable a persistent single-replica SQLite server, project bootstrap,
and a pod sandbox pool using the locally loaded image. This is not a production
HA installation. networkPolicyEnforced: false is intentional: kind’s default
CNI does not enforce NetworkPolicy. A namespaced sandbox here is not evidence
of network isolation. Keep it restricted to trusted synthetic tasks.
Persistence must be configured at first install if you want to retain results. Turning it on during an upgrade does not migrate the old ephemeral database. Finish rollouts before submitting runs: an upgrade is not a readiness test, and old run IDs can become unavailable after switching databases.
Recorded scoring and a sandboxed agent
Section titled “Recorded scoring and a sandboxed agent”kubectl --context "$CONTEXT" apply -n onboarding \ -f examples/first-time-onboarding/kind-recorded.yaml \ -f examples/first-time-onboarding/kind-agent.yamlkubectl --context "$CONTEXT" wait -n onboarding evalrun/onboarding-recorded \ --for=jsonpath='{.status.phase}'=Succeeded --timeout=180skubectl --context "$CONTEXT" wait -n onboarding evalrun/onboarding-agent \ --for=jsonpath='{.status.phase}'=Succeeded --timeout=180skubectl --context "$CONTEXT" get evalrun onboarding-recorded onboarding-agent \ -n onboarding -o yamlInspect status.summaries, not only pod readiness:
| Run | Expected |
|---|---|
onboarding-recorded |
exact-match mean 0.5, n=2; gate passes at 0.5 |
onboarding-agent |
task-success mean 1, n=1; checker confirms out.txt |
The CLI agent is a deterministic shell program, not an LLM. It runs in a pod sandbox; its hidden checker reads the resulting file.
A streamed tool-calling model on the cluster
Section titled “A streamed tool-calling model on the cluster”Install the actual tutorial model from the checkout as a ConfigMap:
kubectl --context "$CONTEXT" create configmap onboarding-model -n onboarding \ --from-file=tinylm.py=examples/tinylm/tinylm.py --dry-run=client -o yaml | kubectl --context "$CONTEXT" apply -n onboarding -f -kubectl --context "$CONTEXT" apply -n onboarding \ -f examples/first-time-onboarding/kind-model.yamlkubectl --context "$CONTEXT" rollout status deployment/onboarding-model \ -n onboarding --timeout=180skubectl --context "$CONTEXT" apply -n onboarding \ -f examples/first-time-onboarding/kind-support.yamlkubectl --context "$CONTEXT" wait -n onboarding evalrun/onboarding-support \ --for=jsonpath='{.status.phase}'=Succeeded --timeout=180sThe model Service is cluster-local. The harness worker calls it using real
streaming HTTP, executes the lookup and refund mocks, and scores the trajectory.
Expect precision=recall=run-completed=1, tool-errors=0 and n=1. The run explicitly
sets api_key_env: none and tools.sandbox: false: these are mock business
tools, not a second sandbox test.
Negative controls: prove the gates reject a regression
Section titled “Negative controls: prove the gates reject a regression”Using an activated Python environment with PyYAML, generate three separate resources without modifying the good examples:
export CONTROLS="$(mktemp -d)"python - <<'PY'import osfrom pathlib import Pathimport yaml
root = Path("examples/first-time-onboarding")out = Path(os.environ["CONTROLS"])for name in ("recorded", "agent", "support"): doc = yaml.safe_load((root / f"kind-{name}.yaml").read_text()) doc["metadata"]["name"] += "-negative" if name == "recorded": doc["spec"]["gates"][0]["min"] = 1.0 elif name == "agent": doc["spec"]["environment"]["checker"]["command"] = ["sh", "-c", "exit 1"] else: doc["spec"]["target"]["model"] = "tinylm-reckless" (out / f"{name}.yaml").write_text(yaml.safe_dump(doc))PYkubectl --context "$CONTEXT" apply -n onboarding -f "$CONTROLS"for name in recorded agent support; do kubectl --context "$CONTEXT" wait -n onboarding "evalrun/onboarding-$name-negative" \ --for=jsonpath='{.status.phase}'=Failed --timeout=180sdoneExpected means: recorded remains 0.5 but its stricter gate fails; the checker
failure gives task-success 0; the reckless model omits lookup so tool-call recall
is 0.5. These should be Failed, not Error or Invalid. Inspect every
summary’s errors and status message if a control does not match.
Troubleshooting and cleanup
Section titled “Troubleshooting and cleanup”kubectl --context "$CONTEXT" get evalruns,pods -n onboardingkubectl --context "$CONTEXT" get events -n onboarding --sort-by=.lastTimestampkubectl --context "$CONTEXT" logs deployment/onboarding-evalsi-operator -n onboardingkubectl --context "$CONTEXT" logs deployment/onboarding-evalsi-worker-harness -n onboardingMissing images usually mean they were not loaded into this cluster.
Invalid usually means a spec, project or credential-grant problem. A model
connection error is not a failed business gate. For more deployment controls,
continue to the Kubernetes guide.
Remove only this disposable cluster and the exact temporary paths created here:
kind delete cluster --name "$CLUSTER"rm -f "$CONTROLS/recorded.yaml" "$CONTROLS/agent.yaml" "$CONTROLS/support.yaml"rmdir "$CONTROLS"rm -f "$KUBECONFIG"unset KUBECONFIG CONTEXT CLUSTER CONTROLS