Skip to main content

Quick Start - Deploy a kubeswarm Agent in 2 Minutes

Deploy your first kubeswarm agent on Kubernetes in under 2 minutes. This guide uses Ollama locally so you can get started with no API keys needed.

Prerequisites

ToolVersionRequired
Kubernetes1.35+Yes (Docker Desktop, Kind, or any cluster)
Helm3.16+Yes
kubectl1.35+Yes
OllamalatestFor this guide (cloud providers work too)

1. Install the operator

helm repo add kubeswarm https://kubeswarm.github.io/helm-charts
helm install kubeswarm kubeswarm/kubeswarm \
--namespace kubeswarm-system --create-namespace

2. Start Ollama

ollama pull qwen2.5:7b
ollama serve

3. Deploy an agent

# agent.yaml
apiVersion: kubeswarm.io/v1alpha1
kind: SwarmAgent
metadata:
name: hello-agent
namespace: default
spec:
model: qwen2.5:7b
prompt:
inline: "You are a helpful assistant running on Kubernetes."
guardrails:
limits:
tokensPerCall: 2048
timeoutSeconds: 60
runtime:
replicas: 1
envFrom:
- configMapRef:
name: ollama-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ollama-config
namespace: default
data:
AGENT_PROVIDER: openai
OPENAI_BASE_URL: http://host.docker.internal:11434/v1
OPENAI_API_KEY: "unused"
kubectl apply -f agent.yaml
kubectl get swagent hello-agent -w

Wait until READY shows 1.

4. Submit a task

kubectl apply -f - <<EOF
apiVersion: kubeswarm.io/v1alpha1
kind: SwarmRun
metadata:
name: hello-run
spec:
agent: hello-agent
prompt: "What is Kubernetes? Answer in 2 sentences."
EOF

5. See the result

kubectl get swrun hello-run -o jsonpath='{.status.output}'

Next steps