Skip to main content
Deploy a Vision Agent to any Kubernetes cluster using the official Helm chart. This guide walks you through every step — from building a container image to seeing live metrics in Grafana.

What you’ll set up

  • Agent running on Kubernetes with health checks
  • Redis for session storage (bundled in the chart)
  • Prometheus metrics scraping
  • Grafana dashboard with live panels (sessions, latency, tokens)

Prerequisites

You’ll also need API keys for the AI services:

Step 1: Get the example

Clone the repository and navigate to the deploy example:

Step 2: Create your .env file

Edit .env and fill in your API keys.

Step 3: Build the Docker image

Generate the lock file and build:
If you’re deploying to a cloud cluster (not local), you’ll need to push the image to a container registry:
Then set image.repository in Step 5 accordingly.

Step 4: Build Helm dependencies

The chart includes Redis as an optional bundled dependency:

Step 5: Install

We disable metrics and grafana for now because they require Prometheus CRDs (ServiceMonitor). We’ll enable them in Step 8.
This deploys:
  • Agent — Deployment with health probes, resource limits, and your API keys
  • Redis — Standalone instance for session storage
  • Service — ClusterIP for internal routing
  • Ingress — External access (disabled by default, enable with ingress.enabled=true and set ingress.host)

Step 6: Verify

Wait for pods to be ready:
You should see two pods reach 1/1 Running:
The agent pod may restart once on first deploy. This happens because the agent tries to connect to Redis at startup, but Redis isn’t ready yet. After the restart, Redis is up and everything works normally.

Test the health endpoint

In another terminal:
Expected: HTTP 200

Create a session

Expected:

Step 7: Verify Redis

Check that the session was stored in Redis:
Expected output:

Step 8: Monitoring (Prometheus + Grafana)

Install the monitoring stack

This installs Prometheus + Grafana with CRDs for ServiceMonitor:

Enable metrics in the agent chart

Now upgrade with metrics and Grafana dashboard enabled:
metrics.additionalLabels.release=monitoring is required so Prometheus discovers the ServiceMonitor. The label must match your Prometheus serviceMonitorSelector — for kube-prometheus-stack, it’s release: <release-name>.
This adds:
  • ServiceMonitor — tells Prometheus to scrape /metrics on the agent pods
  • Grafana Dashboard — auto-provisioned via ConfigMap sidecar

Open Grafana

If you see pod is not running. Current status=Pending, wait a moment for the Grafana pod to start and retry. The monitoring stack takes a bit longer to initialize than the agent.
Open http://localhost:3000 — you’ll see the Grafana login screen. Enter admin / admin.

Grafana login screen

Navigate to Dashboards → Vision Agent Overview.

Vision Agent Overview dashboard in Grafana

You’ll see 7 panels:

Generate some data

Create test sessions to verify the metrics pipeline works end-to-end. The 3-second delay between sessions ensures Prometheus captures active session counts between its 30-second scrape intervals:
The Pod CPU Usage and Pod Memory Usage panels will show data immediately since they use cluster-level metrics. The application-level panels (Active Sessions, Latency, Tokens) will populate as sessions run through the pipeline.
For sustained, non-zero application metrics, connect a real client via the Stream Video SDK. Test sessions created via curl are short-lived and may complete between Prometheus scrape intervals (30s).

Vision Agent Overview dashboard after running test sessions

Configuration reference

values.yaml — key settings

Using managed Redis (production)

For production, use a managed Redis service instead of the bundled one:

Using a custom domain

Troubleshooting

Pod crashes immediately — uv.lock not found

You need to generate the lock file before building:

Server listens on 127.0.0.1 — probes fail

The Dockerfile must use --host 0.0.0.0:
Without --host 0.0.0.0, the server only accepts connections from inside the container, and Kubernetes health probes can’t reach it.

ServiceMonitor exists but Prometheus doesn’t scrape

Prometheus only watches ServiceMonitors with matching labels. Check what your Prometheus expects:
Then add the required label:

Grafana dashboard shows “No data”

  1. Check Prometheus is scraping: open http://localhost:9090/targets (port-forward Prometheus first)
  2. Check the metric exists: in Grafana Explore, query ai_demo_active_sessions
  3. If data shows in Explore but not the dashboard — restart Grafana to reload ConfigMaps:

Cleanup

Remove everything:

Next steps

HTTP Server

API endpoints, session limits, and CORS configuration

Horizontal Scaling

Multi-replica deployment with Redis session registry

Telemetry & Metrics

OpenTelemetry metrics reference and Prometheus queries

Docker Deployment

Docker, GPU, and general deployment tips