---
title: "Helm Charts for AI Agent Deployment: Templated, Reusable Kubernetes Manifests"
description: "Build Helm charts for AI agent deployments — including chart structure, values files, Go templates, dependencies, and chart repositories for reusable, parameterized Kubernetes manifests."
canonical: https://callsphere.ai/blog/helm-charts-ai-agent-deployment-templated-reusable-kubernetes-manifests
category: "Learn Agentic AI"
tags: ["Helm", "Kubernetes", "AI Deployment", "Infrastructure as Code", "DevOps"]
author: "CallSphere Team"
published: 2026-03-17T00:00:00.000Z
updated: 2026-05-06T01:02:45.914Z
---

# Helm Charts for AI Agent Deployment: Templated, Reusable Kubernetes Manifests

> Build Helm charts for AI agent deployments — including chart structure, values files, Go templates, dependencies, and chart repositories for reusable, parameterized Kubernetes manifests.

## Why Helm for AI Agent Deployments

Deploying an AI agent to Kubernetes requires multiple resources: a Deployment, Service, ConfigMap, Secret, HPA, NetworkPolicy, and possibly PVCs and Ingress. Managing these as individual YAML files across development, staging, and production environments creates duplication and drift. Helm packages all resources into a single chart with parameterized values, making deployments repeatable and environment-specific configuration simple.

## Chart Structure

Create a new Helm chart:

```mermaid
flowchart LR
    GIT(["Git push"])
    CI["GitHub Actions
build plus test"]
    REG[("Container registry
GHCR or ECR")]
    HELM["Helm chart
values per env"]
    K8S{"Kubernetes cluster"}
    DEP["Deployment
rolling update"]
    SVC["Service plus Ingress"]
    HPA["HPA
CPU and queue depth"]
    POD[("Inference pods
GPU node pool")]
    USERS(["Production traffic"])
    GIT --> CI --> REG --> HELM --> K8S
    K8S --> DEP --> POD
    K8S --> SVC --> POD
    K8S --> HPA --> POD
    SVC --> USERS
    style CI fill:#4f46e5,stroke:#4338ca,color:#fff
    style POD fill:#ede9fe,stroke:#7c3aed,color:#1e1b4b
    style USERS fill:#059669,stroke:#047857,color:#fff
```

```bash
helm create ai-agent
```

This generates the following structure:

```text
ai-agent/
  Chart.yaml          # Chart metadata
  values.yaml         # Default configuration values
  templates/
    deployment.yaml   # Deployment template
    service.yaml      # Service template
    hpa.yaml          # Autoscaler template
    configmap.yaml    # ConfigMap template
    _helpers.tpl      # Reusable template helpers
    NOTES.txt         # Post-install instructions
```

## Chart.yaml: Metadata

```yaml
# Chart.yaml
apiVersion: v2
name: ai-agent
description: Helm chart for deploying AI agents to Kubernetes
type: application
version: 0.1.0
appVersion: "1.0.0"
keywords:
  - ai
  - agent
  - llm
maintainers:
  - name: AI Platform Team
    email: platform@example.com
```

## values.yaml: Parameterized Defaults

```yaml
# values.yaml
replicaCount: 2

image:
  repository: myregistry/ai-agent
  tag: "1.0.0"
  pullPolicy: IfNotPresent

agent:
  modelName: "gpt-4o"
  temperature: 0.7
  maxTokens: 4096
  logLevel: "INFO"
  systemPrompt: |
    You are a helpful AI assistant.
    Answer questions accurately and concisely.

resources:
  requests:
    memory: "512Mi"
    cpu: "250m"
  limits:
    memory: "2Gi"
    cpu: "1000m"

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 20
  targetCPUUtilization: 60

service:
  type: ClusterIP
  port: 80
  targetPort: 8000

ingress:
  enabled: false
  hostname: agent.example.com
  tls: true

persistence:
  enabled: false
  storageClass: "fast-ssd"
  size: "50Gi"
```

## Deployment Template

```yaml
# templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "ai-agent.fullname" . }}
  labels:
    {{- include "ai-agent.labels" . | nindent 4 }}
spec:
  {{- if not .Values.autoscaling.enabled }}
  replicas: {{ .Values.replicaCount }}
  {{- end }}
  selector:
    matchLabels:
      {{- include "ai-agent.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        {{- include "ai-agent.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
    spec:
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - containerPort: {{ .Values.service.targetPort }}
          envFrom:
            - configMapRef:
                name: {{ include "ai-agent.fullname" . }}-config
            - secretRef:
                name: {{ include "ai-agent.fullname" . }}-secrets
          resources:
            {{- toYaml .Values.resources | nindent 12 }}
          {{- if .Values.persistence.enabled }}
          volumeMounts:
            - name: agent-data
              mountPath: /data
          {{- end }}
      {{- if .Values.persistence.enabled }}
      volumes:
        - name: agent-data
          persistentVolumeClaim:
            claimName: {{ include "ai-agent.fullname" . }}-data
      {{- end }}
```

The `checksum/config` annotation triggers a rolling restart whenever the ConfigMap changes, ensuring Pods always use the latest configuration.

## Helper Templates

```yaml
# templates/_helpers.tpl
{{- define "ai-agent.fullname" -}}
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "ai-agent.labels" -}}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{- define "ai-agent.selectorLabels" -}}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
```

## Environment-Specific Values

Create override files for each environment:

```yaml
# values-production.yaml
replicaCount: 5
image:
  tag: "1.2.0"
agent:
  modelName: "gpt-4o"
  logLevel: "WARNING"
resources:
  requests:
    memory: "1Gi"
    cpu: "500m"
  limits:
    memory: "4Gi"
    cpu: "2000m"
autoscaling:
  enabled: true
  minReplicas: 5
  maxReplicas: 50
ingress:
  enabled: true
  hostname: agent.prod.example.com
```

Deploy with environment-specific values:

```bash
# Development
helm install agent-dev ./ai-agent -n ai-dev -f values-dev.yaml

# Production
helm install agent-prod ./ai-agent -n ai-prod -f values-production.yaml

# Upgrade with new image tag
helm upgrade agent-prod ./ai-agent -n ai-prod \
  -f values-production.yaml \
  --set image.tag="1.3.0"
```

## Chart Dependencies

Include sub-charts for common infrastructure:

```yaml
# Chart.yaml
dependencies:
  - name: redis
    version: "18.x.x"
    repository: "https://charts.bitnami.com/bitnami"
    condition: redis.enabled
  - name: postgresql
    version: "13.x.x"
    repository: "https://charts.bitnami.com/bitnami"
    condition: postgresql.enabled
```

```bash
helm dependency update ./ai-agent
```

## FAQ

### How do I manage secrets in Helm without committing them to version control?

Never put actual secret values in `values.yaml`. Use `helm-secrets` with SOPS encryption, which encrypts values files at rest and decrypts them during deployment. Alternatively, create Secrets separately via a secrets manager and reference them by name in your Helm templates. For CI/CD pipelines, inject secrets as environment variables and use `--set` flags.

### How do I roll back a failed AI agent Helm deployment?

Helm maintains release history. Run `helm rollback agent-prod 1` to revert to revision 1. Kubernetes performs a rolling update back to the previous Pod spec. Always test with `helm upgrade --dry-run` before applying changes to production. Set `--history-max` to control how many revisions Helm retains.

### Can I use Helm to deploy multiple AI agents from a single chart?

Yes. Install the same chart multiple times with different release names and values files. For example, deploy a triage agent and a specialist agent from the same base chart by overriding `image.tag`, `agent.systemPrompt`, and `agent.modelName` in separate values files. This reduces maintenance since infrastructure logic is defined once and parameterized per agent.

---

#Helm #Kubernetes #AIDeployment #InfrastructureAsCode #DevOps #AgenticAI #LearnAI #AIEngineering

---

Source: https://callsphere.ai/blog/helm-charts-ai-agent-deployment-templated-reusable-kubernetes-manifests
