Skip to content
This documentation covers kagent while it is in development and can describe unreleased features. For the current release, see the latest docs.

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Install with Helm

Page as Markdown

Install kagent and Agent Substrate with Helm alone, on a development database, to get a working installation.

Install with Helm

Install kagent with Helm and kubectl alone, in five steps, on a development database. For a production setup, follow Advanced Install.

Start with the CRDs

This page gets a working installation running with Helm, without the kagent CLI. It makes the simplest choices at each step, so that you can copy the commands as they are.

Warning

The database in this page is for evaluation only. It runs in the cluster with fixed passwords, without TLS, and without durable storage. For an installation that you keep, use your own PostgreSQL, as described in Advanced Install.

Before you begin

  1. Have a Kubernetes cluster at version 1.37 or later. To create a local one, see Before you begin on the Install page.

  2. Install helm 3, kubectl, jq, and openssl.

  3. Install kubectl-ate, the Agent Substrate plugin for kubectl. You use it once, to create the identity material.

    curl -fsSL -o kubectl-ate \
      "https://github.com/kagent-dev/substrate/releases/download/v1.0.0/kubectl-ate-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/; s/aarch64/arm64/')"
    chmod +x kubectl-ate
    sudo mv kubectl-ate /usr/local/bin/
    kubectl ate --help
  4. Set your model provider API key. This page uses OpenAI. For other providers, see Configure model providers.

    export OPENAI_API_KEY="your-api-key-here"

1. Install the CRDs

The custom resource definitions of kagent and Agent Substrate install from their own charts. These commands also create the kagent and ate-system namespaces.

helm upgrade --install kagent-crds \
  oci://ghcr.io/kagent-dev/kagent/helm/kagent-crds \
  --version 1.0.1 \
  --namespace kagent --create-namespace --wait

helm upgrade --install substrate-crds \
  oci://ghcr.io/kagent-dev/substrate/helm/substrate-crds \
  --version 1.0.0 \
  --namespace ate-system --create-namespace --wait

2. Set up identity

Agent Substrate signs and verifies the identity of every component. You create the keys that it signs with, tell its API server how to verify callers, and install the controller that issues certificates.

  1. Create the certificate and token pools.

    kubectl create namespace podcertificate-controller-system
    
    for pool in service-dns-ca-pool postgres-ca-pool pod-identity-ca-pool; do
      kubectl ate admin make-ca-pool --ca-id=1 --key-type=ED25519 \
        --name=${pool} --secret-namespace=podcertificate-controller-system
    done
    
    kubectl ate admin make-jwt-pool --key-id=1 \
      --name=actor-id-jwt-pool --secret-namespace=ate-system
    kubectl ate admin make-ca-pool --ca-id=1 --key-type=ED25519 \
      --name=actor-id-ca-pool --secret-namespace=ate-system
    kubectl ate admin make-ca-pool --ca-id=1 --key-type=ECDSAP256 \
      --name=egress-mitm-ca-pool --secret-namespace=ate-system
  2. Configure how the Agent Substrate API server authenticates callers.

    actor_id_ca_root="$(kubectl get secret actor-id-ca-pool -n ate-system \
      -o jsonpath='{.data.pool}' | base64 --decode \
      | jq -r '.CAs[0].RootCertificateDER' | base64 --decode \
      | openssl x509 -inform der -outform pem)"
    
    kubectl create secret generic actor-id-ca-certs -n ate-system \
      --from-literal=ca.crt="${actor_id_ca_root}"
    
    k8s_issuer="$(kubectl get --raw /.well-known/openid-configuration | jq -r .issuer)"
    
    kubectl create configmap ate-api-authentication -n ate-system \
      --from-literal=authentication.yaml="jwtProviders:
    - name: kubernetes
      issuer: ${k8s_issuer}
      audiences: [api.ate-system.svc]
      certificateAuthorityFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
      discoveryTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
    "

    Note

    This configuration suits a cluster whose token issuer is inside the cluster, such as kind. A managed cluster with a public issuer, such as GKE, needs a different form. See Set up certificates and identity.

  3. Install the controller that issues the certificates.

    helm upgrade --install substrate-podcert \
      oci://ghcr.io/kagent-dev/substrate/helm/substrate-podcert \
      --version 1.0.0 \
      --namespace podcertificate-controller-system \
      --wait --timeout 5m

3. Start a development database

kagent and Agent Substrate share one PostgreSQL database, each in its own schema. The charts do not deploy a database, so start one, create the roles and schemas, and store the connection strings.

  1. Run PostgreSQL in the cluster.

    kubectl apply -f - <<EOF
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: postgres
      namespace: kagent
    spec:
      selector:
        matchLabels:
          app: postgres
      template:
        metadata:
          labels:
            app: postgres
        spec:
          containers:
            - name: postgres
              image: postgres:18-alpine
              env:
                - name: POSTGRES_PASSWORD
                  value: dev-admin-password
                - name: POSTGRES_DB
                  value: kagent
              ports:
                - containerPort: 5432
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: postgres
      namespace: kagent
    spec:
      selector:
        app: postgres
      ports:
        - port: 5432
    EOF
    kubectl rollout status deploy/postgres -n kagent --timeout=180s
  2. Create the roles and schemas. Each project ships a setup script, which you run with the psql that is inside the database pod.

    export KAGENT_OWNER_PASSWORD=dev-kagent-owner KAGENT_READWRITE_PASSWORD=dev-kagent-rw
    export SUBSTRATE_OWNER_PASSWORD=dev-substrate-owner SUBSTRATE_READWRITE_PASSWORD=dev-substrate-rw
    
    curl -sSLo kagent-setup.sql https://raw.githubusercontent.com/kagent-dev/kagent/refs/tags/v1.0.1/go/core/pkg/postgressetup/setup.sql
    curl -sSLo substrate-setup.sql https://raw.githubusercontent.com/kagent-dev/substrate/refs/tags/v1.0.0/pkg/postgressetup/setup.sql
    
    kubectl exec -i -n kagent deploy/postgres -- \
      env KAGENT_OWNER_PASSWORD="$KAGENT_OWNER_PASSWORD" KAGENT_READWRITE_PASSWORD="$KAGENT_READWRITE_PASSWORD" \
      psql -U postgres -d kagent --no-psqlrc --set=ON_ERROR_STOP=1 --single-transaction \
      --set=kagent_schema=kagent \
      --set=kagent_owner_role=kagent_owner --set=kagent_owner_user=kagent_owner_user \
      --set=kagent_readwrite_role=kagent_readwrite --set=kagent_readwrite_user=kagent_readwrite_user \
      --command='\getenv kagent_owner_password KAGENT_OWNER_PASSWORD' \
      --command='\getenv kagent_readwrite_password KAGENT_READWRITE_PASSWORD' \
      --file=/dev/stdin < kagent-setup.sql
    
    kubectl exec -i -n kagent deploy/postgres -- \
      env SUBSTRATE_OWNER_PASSWORD="$SUBSTRATE_OWNER_PASSWORD" SUBSTRATE_READWRITE_PASSWORD="$SUBSTRATE_READWRITE_PASSWORD" \
      psql -U postgres -d kagent --no-psqlrc --set=ON_ERROR_STOP=1 --single-transaction \
      --set=substrate_schema=substrate \
      --set=substrate_owner_role=substrate_owner --set=substrate_owner_user=substrate_owner_user \
      --set=substrate_readwrite_role=substrate_readwrite --set=substrate_readwrite_user=substrate_readwrite_user \
      --command='\getenv substrate_owner_password SUBSTRATE_OWNER_PASSWORD' \
      --command='\getenv substrate_readwrite_password SUBSTRATE_READWRITE_PASSWORD' \
      --file=/dev/stdin < substrate-setup.sql
  3. Store the connection strings in the Secrets that the charts read.

    DB="postgres.kagent.svc:5432/kagent?sslmode=disable"
    
    kubectl create secret generic kagent-postgres-owner -n kagent \
      --from-literal=ownerConnectionString="postgresql://kagent_owner_user:${KAGENT_OWNER_PASSWORD}@${DB}"
    kubectl create secret generic kagent-postgres-readwrite -n kagent \
      --from-literal=readWriteConnectionString="postgresql://kagent_readwrite_user:${KAGENT_READWRITE_PASSWORD}@${DB}"
    kubectl create secret generic substrate-postgres-owner -n ate-system \
      --from-literal=ownerConnectionString="postgresql://substrate_owner_user:${SUBSTRATE_OWNER_PASSWORD}@${DB}"
    kubectl create secret generic substrate-postgres-readwrite -n ate-system \
      --from-literal=readWriteConnectionString="postgresql://substrate_readwrite_user:${SUBSTRATE_READWRITE_PASSWORD}@${DB}"

4. Install Agent Substrate

Agent Substrate installs as two releases: substrate-atelet, the agent that runs on each node, and substrate, the control plane.

  1. Install atelet, and wait for it to roll out.

    kubectl create secret generic kagent-rustfs-credentials -n ate-system \
      --from-literal=AWS_ACCESS_KEY_ID=rustfsadmin \
      --from-literal=AWS_SECRET_ACCESS_KEY=rustfsadmin
    
    helm upgrade --install substrate-atelet \
      oci://ghcr.io/kagent-dev/substrate/helm/substrate-atelet \
      --version 1.0.0 \
      --namespace ate-system \
      --wait --timeout 10m \
      -f - <<EOF
    preview:
      - PerTemplateSnapshotLocation
      - GoldenEgressPolicy
    objectStore:
      backend: s3
      endpoint: http://rustfs.ate-system.svc:9000
      region: us-east-1
      pathStyle: true
      credentialsSecret: kagent-rustfs-credentials
    EOF
    
    kubectl rollout status daemonset/atelet -n ate-system --timeout=5m
  2. Install the control plane.

    helm upgrade --install substrate \
      oci://ghcr.io/kagent-dev/substrate/helm/substrate \
      --version 1.0.0 \
      --namespace ate-system \
      --wait --timeout 10m \
      -f - <<EOF
    atelet:
      enabled: false
    preview:
      - PerTemplateSnapshotLocation
      - GoldenEgressPolicy
    ateApi:
      authorization:
        bootstrapOwners:
          - spiffe://cluster.local/ns/kagent/sa/kagent-controller
          - system:serviceaccount:ate-system:ate-client
    atenetRouter:
      ingressAllowedSPIFFEIDs:
        - spiffe://cluster.local/ns/kagent/sa/kagent-controller
    credentialProvider:
      namespacePolicies:
        - atespace: kagent
          allowedNamespaces: [kagent]
    EOF

5. Install kagent

  1. Store your API key, and let the kagent namespace reach the Agent Substrate API.

    kubectl create secret generic kagent-openai -n kagent \
      --from-literal=OPENAI_API_KEY="${OPENAI_API_KEY}"
    
    kubectl label namespace kagent ate.dev/api-access=true
  2. Install kagent. The values create the worker pool and the three default harnesses, so that you can build an agent straight away.

    helm upgrade --install kagent \
      oci://ghcr.io/kagent-dev/kagent/helm/kagent \
      --version 1.0.1 \
      --namespace kagent --timeout 12m \
      -f - <<EOF
    config:
      server:
        grpcReflection: true
    controller:
      substrateClientCertificate:
        enabled: true
    substrateWorkerPool:
      create: true
      workerImage: "ghcr.io/kagent-dev/substrate/ateworker-gvisor:v1.0.0"
    harnesses:
      enabled: true
    EOF
    
    kubectl rollout status deployment/kagent-controller -n kagent --timeout=300s

Check the installation

  1. List the releases. All six show deployed.

    helm list -A

    Example output:

    NAME               NAMESPACE                          STATUS    CHART
    kagent             kagent                             deployed  kagent-1.0.1
    kagent-crds        kagent                             deployed  kagent-crds-1.0.1
    substrate          ate-system                         deployed  substrate-1.0.0
    substrate-atelet   ate-system                         deployed  substrate-atelet-1.0.0
    substrate-crds     ate-system                         deployed  substrate-crds-1.0.0
    substrate-podcert  podcertificate-controller-system   deployed  substrate-podcert-1.0.0
    
  2. Wait until the kagent pods are running.

    kubectl wait pods --all -n kagent --for=condition=Ready --timeout=300s
  3. Open the UI. Leave the command running, and open http://localhost:8082.

    kubectl port-forward -n kagent svc/kagent-ui 8082:8080

Now build your first agent.