|
| 1 | +--- |
| 2 | +title: "Installation" |
| 3 | +linkTitle: "Installation" |
| 4 | +weight: 3 |
| 5 | +description: > |
| 6 | + Installing Agent Sandbox to a Kubernetes Cluster |
| 7 | +--- |
| 8 | +This guide provides step-by-step instructions for installing and running the agent-sandbox controller on kind (Kubernetes in Docker) for local development and testing. |
| 9 | + |
| 10 | +## Before You Begin |
| 11 | + |
| 12 | +Ensure you have the following prerequisites installed: |
| 13 | + |
| 14 | +**Required Tools:** |
| 15 | +- [Docker](https://docs.docker.com/get-docker/) |
| 16 | +- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) |
| 17 | +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) |
| 18 | + |
| 19 | +**Verify installations:** |
| 20 | +```bash |
| 21 | +docker --version |
| 22 | +kind --version |
| 23 | +kubectl version --client |
| 24 | +``` |
| 25 | +## Create a Kind cluster |
| 26 | + |
| 27 | +Create a kind cluster with: |
| 28 | + |
| 29 | +```bash |
| 30 | +kind create cluster --name agent-sandbox |
| 31 | +``` |
| 32 | + |
| 33 | +## Deploy Agent-Sandbox to kind |
| 34 | + |
| 35 | +### Clone the Repository |
| 36 | + |
| 37 | +```bash |
| 38 | +git clone https://github.com/kubernetes-sigs/agent-sandbox.git |
| 39 | +cd agent-sandbox |
| 40 | +``` |
| 41 | +### Deploy to kind |
| 42 | + |
| 43 | +With kubectl install the controller: |
| 44 | + |
| 45 | +```bash |
| 46 | +export VERSION=v0.1.0 |
| 47 | +kubectl apply -f https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${VERSION}/manifest.yaml |
| 48 | +kubectl apply -f https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${VERSION}/extensions.yaml |
| 49 | +``` |
| 50 | + |
| 51 | +This command will: |
| 52 | +1. Create a kind cluster named `agent-sandbox` (if it doesn't exist) |
| 53 | +2. Build the controller container image |
| 54 | +3. Load the image into the kind cluster |
| 55 | +4. Deploy the controller to the cluster in the `agent-sandbox-system` namespace |
| 56 | + |
| 57 | +### Verify Installation |
| 58 | + |
| 59 | +Check that the controller is running: |
| 60 | + |
| 61 | +```bash |
| 62 | +# Check controller pod status |
| 63 | +kubectl get pods -n agent-sandbox-system |
| 64 | + |
| 65 | +# Verify CRDs are installed |
| 66 | +kubectl get crds | grep agents.x-k8s.io |
| 67 | + |
| 68 | +# Check controller logs |
| 69 | +kubectl logs -n agent-sandbox-system -l control-plane=controller-manager -f |
| 70 | +``` |
| 71 | + |
| 72 | +You should see the controller pod in `Running` state. |
| 73 | + |
| 74 | +## Uninstall |
| 75 | + |
| 76 | +Remove agent-sandbox from your cluster: |
| 77 | + |
| 78 | +```bash |
| 79 | +# Delete all sandbox resources |
| 80 | +kubectl delete sandboxes --all |
| 81 | + |
| 82 | +# Remove the controller and namespace |
| 83 | +kubectl delete namespace agent-sandbox-system |
| 84 | + |
| 85 | +# Delete CRDs |
| 86 | +kubectl delete crd sandboxes.agents.x-k8s.io |
| 87 | +``` |
| 88 | + |
| 89 | +Delete the kind cluster: |
| 90 | + |
| 91 | +```bash |
| 92 | +kind delete cluster --name agent-sandbox |
| 93 | +``` |
| 94 | + |
| 95 | +## Troubleshooting |
| 96 | + |
| 97 | +**Controller pod not starting:** |
| 98 | +- Check logs: `kubectl logs -l app=agent-sandbox-controller` |
| 99 | +- Verify RBAC permissions: `kubectl get clusterroles,clusterrolebindings | grep agent-sandbox` |
| 100 | +- Check if CRDs are properly installed: `kubectl get crds | grep agents` |
| 101 | +- Verify the image is correct: `kubectl get statefulset agent-sandbox-controller -o yaml | grep image:` |
| 102 | + |
| 103 | +**Storage issues:** |
| 104 | +- kind uses local Docker storage - ensure Docker has enough disk space |
| 105 | +- Check Docker disk usage: `docker system df` |
| 106 | +- Clean up unused images: `docker system prune` |
| 107 | +- Verify PVC is bound: `kubectl get pvc` |
| 108 | + |
| 109 | +**Out of memory errors:** |
| 110 | +- kind uses Docker resources - check Docker resource limits in Docker Desktop settings |
| 111 | +- Increase Docker memory allocation (recommend 8GB+ for development) |
| 112 | +- Reduce sandbox resource requests if needed |
| 113 | + |
| 114 | +**Building the Controller Binary:** |
| 115 | + |
| 116 | +To build just the controller binary: |
| 117 | + |
| 118 | +```bash |
| 119 | +make build |
| 120 | +``` |
| 121 | + |
| 122 | +Binary will be at `bin/manager`. |
| 123 | + |
| 124 | +**Regenerating CRDs and RBAC:** |
| 125 | + |
| 126 | +After modifying `api/` or `controllers/` directories: |
| 127 | + |
| 128 | +```bash |
| 129 | +make all |
| 130 | +``` |
| 131 | + |
| 132 | +## Additional Resources |
| 133 | + |
| 134 | +- [Agent-Sandbox GitHub Repository](https://github.com/kubernetes-sigs/agent-sandbox) |
| 135 | +- [Agent-Sandbox Development Guide](https://github.com/kubernetes-sigs/agent-sandbox/blob/main/docs/development.md) |
| 136 | +- [kind Documentation](https://kind.sigs.k8s.io/) |
| 137 | +- [Kubernetes SIG-Apps](https://github.com/kubernetes/community/tree/master/sig-apps) |
0 commit comments