Helm doesn't support specify value.yaml when packaging chart archive. Therefore this plugin helps developers merge one or more YAML files of values for easily packaging different environments Helm Charts.
Fetch the latest binary release of helm-values and install it:
$ helm plugin install https://github.com/shihyuho/helm-values
$ helm values [flags] CHART
Flags:
--backup-suffix string suffix append to values.yaml if values.yaml already exist in output-dir (default ".bak")
-h, --help help for helm
-o, --output-dir string writes the merged values to files in output-dir instead of stdout
-f, --values valueFiles specify values in a YAML file (can specify multiple) (default [])
The structure is like:
.
├── mychart
│ ├── .helmignore
│ ├── Chart.yaml
│ ├── charts
│ ├── templates
│ └── values.yaml
└── myenv
├── dev.yaml
├── sit.yaml
└── uat.yaml
The script for package different environments chart archive:
# Merge sit values.yaml
$ helm values mychart --values myenv/sit.yaml --output-dir mychart
# Package
$ helm package mychart
# Restore values.yaml
$ mv mychart/values.yaml.bak mychart/values.yaml