Helmfile
Helmfile: Declarative Helm Chart Management for Kubernetes
Helmfile is a powerful layer on top of Helm that helps you define, install, and manage multiple Helm chart deployments in a declarative way. Itβs especially useful for managing multiple environments, complex dependencies, and large-scale applications across Kubernetes clusters.
π§ Learning Plan
- Introduction to Helmfile
- Core Concepts:
helmfile.yaml - Basic Helmfile Commands
- Advanced Features and Examples
- Best Practices and Resources
π Introduction to Helmfile
Imagine youβre managing a large application deployed on Kubernetes using Helm. You might have several Helm charts for different components like your web server, database, and caching system. Using plain Helm, youβd have to run Helm commands for each of these charts individually β installing, upgrading, uninstalling, and keeping track of their configurations. It can get quite cumbersome, like trying to conduct each instrument in an orchestra separately!
Thatβs where Helmfile comes in. Think of Helmfile as the conductor of your Helm orchestra. It allows you to define all your Helm chart releases in a single file, usually named helmfile.yaml. This file tells Helmfile which charts to deploy, their configurations, and even their dependencies. With a single Helmfile command, you can then manage all these releases together.
So, instead of running multiple helm install or helm upgrade commands, you run a single helmfile apply command, and Helmfile takes care of the rest, ensuring all your charts are deployed in the desired state.
Using plain Helm, managing multiple charts manually becomes cumbersomeβespecially in large-scale environments. Helmfile solves this by letting you declare what should be deployed and how, using a single helmfile.yaml.
Helmfile acts as the conductor of your Helm-based deployments:
- One command to manage multiple Helm charts.
- Declarative management of configurations.
- Easier CI/CD automation.
βοΈ Installation Guide
π§ Install Helmfile (Linux/macOS)
- Download from GitHub Releases
- Rename and move it to your system path:
mv helmfile_linux_amd64 helmfile
chmod +x helmfile
sudo mv helmfile /usr/local/bin/
- Verify installation:
helmfile --version
π Your First Helmfile Project
Step 1: Create a Helm Chart
helm create helloworld
Step 2: Create helmfile.yaml
releases:
- name: helloworld
chart: ./helloworld
installed: true
Set
installed: trueto ensure the chart is deployed
Step 3: Sync the Helm Chart
helmfile sync
Step 4: Verify Release
helm list -A
Step 5: Uninstall via Helmfile
Change installed: false and run:
helmfile sync
π helmfile.yaml: Core Structure
Key Sections:
- repositories: Define external Helm chart sources
- releases: Define what to deploy and how
- values: Inline or file-based overrides
Example:
repositories:
- name: bitnami
url: https://charts.bitnami.com/bitnami
releases:
- name: nginx-app
namespace: default
chart: bitnami/nginx
version: 19.1.1
values:
- service:
type: LoadBalancer
- name: postgres-db
namespace: staging
chart: bitnami/postgresql
version: 16.6.3
values:
- auth:
username: "dbuser"
password: "secret"
replicationPassword: "replica123"
π₯ Advanced Features
| Feature | Description |
|---|---|
environments: |
Manage stage/dev/prod configs |
secrets: |
Support for SOPS-encrypted secrets |
helmfile apply |
Show diff before applying |
helmfile template |
Render charts locally |
selectors: |
Target specific releases by label |
π Conclusion
Helmfile turns Helm into a declarative, CI/CD-friendly deployment solution for Kubernetes. It eliminates manual errors and simplifies configuration management for teams.
Adopt Helmfile to streamline your multi-chart Helm workflows and confidently scale your Kubernetes operations.
π Further Resources
- π Helmfile GitHub
- π Helm Docs
- π Helm Chart Best Practices
Happy Helming with Helmfile! π³οΈ