Deploy Kubernetes Helm Charts
Helmfile is a declarative spec for deploying helm charts. It lets you...
- Keep a directory of chart value files and maintain changes in version control.
- Apply CI/CD to configuration changes.
- Periodically sync to avoid skew in environments.
To avoid upgrades for each iteration of helm
, the helmfile
executable delegates to helm
- as a result, helm
must be installed.
The default helmfile is charts.yaml
:
repositories:
- name: roboll
url: http://roboll.io/charts
charts:
# Published chart example
- name: vault # helm deployment name
namespace: vault # target namespace
chart: roboll/vault-secret-manager # chart reference (repository)
values: [ vault.yaml ] # value files (--values)
set: # values (--set)
- name: address
value: https://vault.example.com
env: # values (--set) but value will be pulled from environment variables. Will throw an error if the environment variable is not set.
- name: db.password
value: DB_PASSWORD # $DB_PASSOWRD needs to be set in the calling environment ex: export DB_PASSWORD='password1'
# Local chart example
- name: grafana # helm deployment name
namespace: another # target namespace
chart: ../my-charts/grafana # chart reference (relative path to manifest)
values:
- ../../my-values/grafana/values.yaml # Values file (relative path to manifest)
go get github.com/roboll/helmfile
or releases or container
NAME:
helmfile -
USAGE:
main [global options] command [command options] [arguments...]
COMMANDS:
repos sync repositories from state file (helm repo add && helm repo update)
charts sync charts from state file (helm repo upgrade --install)
diff diff charts from state file against env (helm diff)
sync sync all resources from state file (repos && charts)
delete delete charts from state file (helm delete)
GLOBAL OPTIONS:
--file FILE, -f FILE load config from FILE (default: "charts.yaml")
--quiet, -q silence output
--kube-context value Set kubectl context. Uses current context by default
--help, -h show help
--version, -v print the version
The helmfile diff
sub-command executes the helm-diff plugin across all of
the charts/releases defined in the manifest.
Under the covers Helmfile is simply using the helm diff
plugin, so that needs to be installed prior. For Helm 2.3+
you should be able to simply execute helm plugin install https://github.com/databus23/helm-diff
. For more details
please look at their documentation.
Using manifest files in conjunction with command line argument can be a bit confusing.
A few rules to clear up this ambiguity:
- Absolute paths are always resolved as absolute paths
- Relative paths referenced in the helmfile manifest itself are relative to that manifest
- Relative paths referenced on the command line are relative to the current working directory the user is in
For additional context, take a look at paths examples