Declaratively deploy your Kubernetes manifests, Kustomize configs, and Charts as Helm releases in one shot
Go to file
Yusuke KUOKA a31757ae07 Purge releases on deletion
So that we can just reuse release names after `helmfile delete`.

This is verified to work by confirming that `helmfile delete` does add `--purge` flag to `helm delete`:

```
$ helmfile delete
exec: helm delete --purge brigade-project
release "brigade-project" deleted
```

And by confirming that I can now re-install releases from the same charts.yaml without any modification of release names:

```
PROJECT=deis/empty-testbed ENV=staging IMAGE=mumoshu/golang-k8s-aws:1.9.1 COMMAND='go' SERVICE_ACCOUNT=default helmfile sync
Release "brigade-project" does not exist. Installing it now.
NAME:   brigade-project
LAST DEPLOYED: Tue Feb 27 15:59:38 2018
NAMESPACE: kube-system
STATUS: DEPLOYED

RESOURCES:
*snip*
```

Fixes #33
2018-02-27 16:01:06 +09:00
examples Adding in examples for readme 2017-10-03 20:23:55 -05:00
helmexec Purge releases on deletion 2018-02-27 16:01:06 +09:00
state Added ability to set context in charts.yaml (#21) 2018-01-02 16:49:02 -05:00
vendor vendor: add deps 2016-11-22 12:37:41 -05:00
.gitignore Adding in examples for readme 2017-10-03 20:23:55 -05:00
Dockerfile container: add helm 2016-11-22 21:40:24 -05:00
LICENSE Create LICENSE 2017-11-10 16:07:38 -05:00
Makefile ignore standard ignores 2017-04-19 15:31:15 -04:00
PATHS.md Adding in examples for readme 2017-10-03 20:23:55 -05:00
README.md Added ability to set context in charts.yaml (#21) 2018-01-02 16:49:02 -05:00
circle.yml build: add docker login 2016-11-22 21:40:50 -05:00
main.go Added ability to set context in charts.yaml (#21) 2018-01-02 16:49:02 -05:00

README.md

helmfile CircleCI

Deploy Kubernetes Helm Charts

Docker Repository on Quay

about

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

context: kube-context					 # kube-context (--kube-context)

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
      - name: db.password
        value: {{ env "DB_PASSWORD" }}                   # value taken from environment variable. Will throw an error if the environment variable is not set. $DB_PASSWORD needs to be set in the calling environment ex: export DB_PASSWORD='password1'
      - name: proxy.domain
        value: "{{ env \"PLATFORM_ID\" }}.my-domain.com" # Interpolate environment variable with a fixed string

  # 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)
    - "./values/{{ env \"PLATFORM_ENV\" }}/config.yaml" # Values file taken from path with environment variable. $PLATFORM_ENV must be set in the calling environment.

install

go get github.com/roboll/helmfile or releases or container

usage

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

diff

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.

Paths Overview

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