Room 42
HELM CHARTS
The Package Forge
- Helm is the package manager for Kubernetes. Charts are templates for deploying complex apps.
- Install a chart, inspect its templates, and find the password.
📜 Mission Briefing
- Add the bitnami repo:
helm repo add bitnami https://charts.bitnami.com/bitnami. - Search for charts:
helm search repo nginx. - Install nginx:
helm install my-nginx bitnami/nginx --set service.type=ClusterIP. - List releases:
helm list. - Get the release notes:
helm get notes my-nginx. - The chart’s values contain an escape annotation. Use
helm get values my-nginxor check the deployed ConfigMap. - Create your own chart:
helm create escape-chart. Inspect the templates. - The password is
helmchar.
Key Commands
| Command | Purpose |
|---|---|
helm repo add NAME URL | Add chart repo |
helm search repo TERM | Search for charts |
helm install RELEASE CHART | Install a chart |
helm upgrade RELEASE CHART | Upgrade release |
helm rollback RELEASE REVISION | Rollback |
helm list | List installed releases |
helm uninstall RELEASE | Remove release |
helm create NAME | Scaffold a new chart |
helm template CHART | Render templates locally |
How Helm Works
# Helm architecture:
# Chart: Package of K8s manifests + templates
# Release: Installed instance of a chart
# Values: Configuration parameters (values.yaml)
# Repo management
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm search repo nginx
# Install with custom values
helm install my-app bitnami/nginx \
--set replicaCount=3 \
--set service.type=ClusterIP \
--namespace web --create-namespace
# Install with values file
helm install my-app bitnami/nginx -f custom-values.yaml
# Upgrade
helm upgrade my-app bitnami/nginx --set replicaCount=5
# Rollback
helm history my-app
helm rollback my-app 1
# Create your own chart
helm create my-chart
# my-chart/
# Chart.yaml # Chart metadata
# values.yaml # Default values
# templates/ # K8s manifest templates
# deployment.yaml
# service.yaml
# _helpers.tpl # Template helpers
# charts/ # Dependencies
# Template rendering
helm template my-chart ./my-chart
helm template my-chart ./my-chart --set key=value
Hints
Hint 1
Hint 3
The password is helmchar.