kagent tutorial: Kubernetes agents, Ollama and tracing

Learn how kagent composes agents in Kubernetes, connects to Ollama and exposes traces and logs, with efficiency metrics derived from spans.

Player not loading? Watch on YouTube

This tutorial explains kagent's Kubernetes resource model and builds a crew with an orchestrator and specialist agents. Models, MCP servers and skills are reusable building blocks that agents reference by name. The speaker contrasts this approach with Symposium: kagent has no separate Team CRD, and agents call other agents as tools through A2A.

The setup uses self-hosted qwen3.6 through Ollama on a Mac Studio. ModelConfig points agents at a local LLM or an external provider. The installation discussion covers Kubernetes controllers, optional monitoring components and a CLI. Persistent memory uses Postgres with pgvector, which needs enabling at installation if using the storage supplied by kagent.

One configuration detail gets particular attention: referencing an MCP server imports all its tools unless toolNames filters them. The speaker recommends limiting tools to reduce input tokens. The runtime explanation distinguishes ordinary Deployments, SandboxAgent workloads on Agent Substrate with gVisor isolation, and AgentHarness environments for third-party coding agents.

For observability, the presenter configures OpenTelemetry and builds Dynatrace dashboards for control plane health and agent efficiency. In the version described, kagent exports traces and logs over OTLP, but no OTLP metrics. Token usage, tool latency and error measurements therefore come from span aggregation.