| name | helm-chart-todo-app |
| description | Generate Helm 3+ chart structure for todo/task applications. Use for: creating Chart.yaml, values.yaml, and templates/ directory with Deployment and Service manifests. Triggers: "helm chart", "helm template", "helm values", "create helm chart", "helm install", "helm upgrade", "package as helm chart". NOT for: plain Kubernetes YAML (use kubernetes-yaml-best-practices), Kustomize, or kubectl commands. NOT for: CRDs, hooks, subcharts, or advanced Helm features unless explicitly requested.
|
Helm Chart Todo App
Generate beginner-friendly Helm 3+ charts for todo/task applications.
Chart Structure
<chart-name>/
├── Chart.yaml # Chart metadata
├── values.yaml # Default configuration
└── templates/
├── deployment.yaml # Deployment manifest
├── service.yaml # Service manifest
└── _helpers.tpl # Template helpers (optional)
Chart.yaml
apiVersion: v2
name: todo-app
description: A Helm chart for Todo application
type: application
version: 0.1.0
appVersion: "1.0.0"
values.yaml
replicaCount: 2
image:
repository: todo-app
tag: "1.0.0"
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
targetPort: 8000
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "500m"
env:
DATABASE_URL: ""
LOG_LEVEL: "info"
healthCheck:
path: /health
port: 8000
templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-deployment
labels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.service.targetPort }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
readinessProbe:
httpGet:
path: {{ .Values.healthCheck.path }}
port: {{ .Values.healthCheck.port }}
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: {{ .Values.healthCheck.path }}
port: {{ .Values.healthCheck.port }}
initialDelaySeconds: 15
periodSeconds: 20
templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-service
labels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
type: {{ .Values.service.type }}
selector:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
protocol: TCP
Common Commands
helm install todo-release ./todo-app --dry-run --debug
helm install todo-release ./todo-app
helm install todo-release ./todo-app --set replicaCount=3
helm install todo-release ./todo-app -f custom-values.yaml
helm upgrade todo-release ./todo-app
helm list
helm uninstall todo-release
Override Values Examples
For local minikube development:
image:
repository: todo-backend
tag: dev
pullPolicy: Never
replicaCount: 1
For production:
image:
repository: myregistry.io/todo-backend
tag: "1.2.3"
replicaCount: 3
resources:
requests:
memory: "256Mi"
cpu: "200m"
limits:
memory: "512Mi"
cpu: "1000m"
Template Syntax Quick Reference
| Syntax | Purpose |
|---|
{{ .Values.x }} | Access values.yaml |
{{ .Release.Name }} | Helm release name |
{{ .Chart.Name }} | Chart name from Chart.yaml |
{{ .Release.Namespace }} | Target namespace |
{{- toYaml .Values.x | nindent N }} | Render YAML with indentation |
{{ $var | quote }} | Quote string values |