Cloud Intermediate
Helm Charts from Scratch¶
HelmKubernetesPackage Manager 3 min read
Kubernetes package manager. Creating, configuring and deploying Helm charts.
Basics¶
# Create a new chart
helm create myapp
# Structure:
# myapp/
# Chart.yaml # Metadata
# values.yaml # Default configuration
# templates/ # K8s manifests with templating
# deployment.yaml
# service.yaml
# ingress.yaml
values.yaml and Templating¶
# values.yaml
replicaCount: 3
image:
repository: myapp
tag: v1.0.0
service:
type: ClusterIP
port: 80
# templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
spec:
replicas: {{ .Values.replicaCount }}
template:
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: {{ .Values.service.port }}
Commands¶
helm install myapp ./myapp -f prod-values.yaml
helm upgrade myapp ./myapp --set image.tag=v2.0.0
helm rollback myapp 1
helm list
helm uninstall myapp
Summary¶
Helm is the de facto standard for K8s packaging. Use values.yaml for environment-specific configurations.
Need Help with Implementation?¶
Our team has experience designing and implementing modern architectures. We’re happy to help.