Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:A5c ai Babysitter Kubernetes Cluster

From Leeroopedia
Knowledge Sources
Domains Infrastructure, Orchestration
Last Updated 2026-10-23 00:00 GMT

Overview

Kubernetes cluster environment with CRD support, PVC provisioning, and Job-based agent dispatch for the Kradle control plane.

Description

This environment provides a Kubernetes cluster capable of running the Kradle agent dispatch system. It requires support for Custom Resource Definitions (CRDs) for 89 resource kinds, PersistentVolumeClaims for workspace provisioning, and batch/v1 Jobs for agent execution. The cluster must support a default StorageClass for PVC binding. The system is tested with minikube for local development and supports existing clusters via kube-context configuration.

Usage

Use this environment for agent dispatch workflows that create K8s Jobs, workspace provisioning that creates PVCs, and permission review that inspects cluster resources. It is the mandatory prerequisite for `k8s_job_creation`, `workspace_provisioning`, and `permission_review` implementations.

System Requirements

Category Requirement Notes
OS Kubernetes 1.27+ batch/v1 Jobs, PVCs, CRDs
Hardware 2+ CPU cores, 8GB RAM For minikube; production clusters scale per workload
Disk 10Gi+ per workspace PVC Default capacity; configurable via volumeSpec
Storage Default StorageClass PVCs bind against cluster default; do NOT hardcode storageClassName
Network Ingress controller For callback URLs and external access

Dependencies

System Packages

  • `kubectl` >= 1.27 (for status and resource inspection)
  • Kubernetes cluster access (kubeconfig or in-cluster service account)

CRD Requirements

  • 89 Custom Resource Definitions (58 CONFIG + 31 AGGREGATED)
  • `batch/v1` Job API
  • `v1` PersistentVolumeClaim API

Kradle CRDs

  • AgentStack, AgentDispatchRun, AgentDispatchAttempt
  • AgentWorkspace, AgentSession, AgentSessionTranscript
  • AgentTransportBinding, AgentPermissionReview
  • AgentMemory, AgentTriggerRule, AgentApproval
  • Organization, User, Team, Repository, Policy

Credentials

The following environment variables or secrets are required:

  • `KRADLE_GIT_BASE_URL`: Gitea base URL for workspace git operations
  • `KRADLE_GIT_USER`: Gitea user for workspace git operations
  • `KRADLE_GIT_PASSWORD`: Gitea password for workspace git operations
  • `KRADLE_WORKSPACE_STORAGE_CLASS`: Override PVC storage class (optional; omit to use cluster default)
  • `KRADLE_CALLBACK_URL`: Callback endpoint for agent result collection
  • `AGENT_MUX_TRANSPORT`: Transport binding env var injected into Job pods
  • `TRANSPORT_MUX_CODEC`: Codec env var injected into Job pods
  • Model provider API keys via K8s Secrets (referenced by AgentSecretGrant)

Quick Install

# Local development with minikube
minikube start --cpus=2 --memory=8192 --disk-size=20g

# Verify cluster access
kubectl get nodes

# Install Kradle (renders Terraform + Helm)
node packages/kradle/installer/dist/cli.js install --env minikube

Code Evidence

K8s resource inspection from `packages/kradle/installer/src/sdk/deploy.ts:139-154`:

const commands = [
  `kubectl get deploy,svc,ingress,pvc -n ${config.namespace} -o json`,
];
if (!(await commandExists("kubectl"))) {
  return { namespace: config.namespace, resources: [], commands };
}
const args = ["get", "deploy,svc,ingress,pvc", "-n", config.namespace, "-o", "json"];
if (config.target.type === "existing") {
  args.push("--context", config.target.kubeContext);
}

K8s Job creation from `packages/kradle/core/src/agent-dispatch-controller.js:577-601`:

const { jobManifest, jobName } = agentMuxClient.createAgentJob({
  adapter: executionConfig.adapter,
  provider: executionConfig.provider,
  model: executionConfig.model,
  org: organizationRef,
  runId: runName,
  stackName: stack.metadata?.name,
  budget: stack.spec?.budget,
  image: stack.spec?.image,
  serviceAccount: stack.spec?.runtimeIdentity?.serviceAccountRef,
  callbackUrl: resolvedCallbackUrl,
  // ...
});
const submitResult = await agentMuxClient.submitAgentJob(jobManifest);

PVC manifest generation from `packages/kradle/core/src/agent-workspace-controller.js:49-56`:

const pvcName = `kradle-ws-${workspaceName}`;
// Omit storageClassName unless explicitly set so the PVC binds against
// the cluster's DEFAULT StorageClass.
const storageClassName = volumeSpec.storageClassName
  || process.env.KRADLE_WORKSPACE_STORAGE_CLASS || undefined;
const capacity = volumeSpec.capacity || '10Gi';

Common Errors

Error Message Cause Solution
`storageclass 'standard' not found` Hardcoded storageClassName doesn't match cluster default Omit storageClassName or set `KRADLE_WORKSPACE_STORAGE_CLASS` env var
`Job submit failed` K8s Job manifest generation or submission error Check the `conditions` field on AgentDispatchRun for `ManifestFailed` or `SubmitFailed` reason
`Pod stays Pending` PVC not bound or insufficient resources Verify default StorageClass exists and cluster has available resources

Compatibility Notes

  • AKS: Default StorageClass is `managed-csi` (not `standard`). Omit storageClassName to let PVC bind against cluster default.
  • GKE: Default StorageClass is `standard` or `premium-rwo`. Same rule: omit storageClassName.
  • minikube: Default StorageClass is `standard`. Works out of the box with default config.
  • Existing clusters: Use `--kube-context` flag or `target.kubeContext` in cloud config.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment