1 min de lectura
Complete Guide to Helm Charts for Kubernetes
Helm is the package manager for Kubernetes. Learn how to leverage Helm Charts to simplify deployments.
What is Helm?
Helm helps you manage Kubernetes applications through Charts - packages of pre-configured Kubernetes resources.
Creating Your First Chart
helm create my-app
This creates the following structure:
my-app/
βββ Chart.yaml # Chart metadata
βββ values.yaml # Default configuration
βββ templates/ # Kubernetes manifests
β βββ deployment.yaml
β βββ service.yaml
β βββ ingress.yaml
βββ charts/ # Dependencies
Values and Templates
values.yaml
replicaCount: 3
image:
repository: nginx
tag: "1.21"
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
resources:
limits:
cpu: 100m
memory: 128Mi
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "my-app.fullname" . }}
spec:
replicas: {{ .Values.replicaCount }}
template:
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
resources:
{{- toYaml .Values.resources | nindent 12 }}
Best Practices
- Use semantic versioning for Chart versions
- Document values.yaml with comments
- Test charts with
helm lintandhelm template - Use hooks for migrations and cleanup
Conclusion
Helm Charts are essential for managing Kubernetes applications at scale. Master them to improve your deployment workflows.
Liked it? Share it!
Comments (0)