DevOps Dudes
Published in

DevOps Dudes

Automating helm releases with helmfile & helmfile-deploy

If you deploy applications to Kubernetes, you probably have brushed shoulders with Helm charts and have likely even developed a chart on your own. Helm charts are a great way to custom tailor each installation/upgrade of a given application by dynamically generating all the Kubernetes YAML based on the set of values that you pass each invocation of helm.

Helm is great and all, but at the end of the day if you have more than one application, each with with their own continually evolving cycle of new versions and corresponding unique sets of values… well this becomes a lot to manage. Especially when you have multiple versions of any one application deployed at a time, and always want to be able to re-produce that state on demand, or simply look somewhere to to quickly see that “desired” state. You essentially need a “table of contents” for all your Helm chart releases.

Helmfile

Well thankfully there are several tools out there for this kind of use case, one of which is Helmfile.

Helmfile as a tool that lets your declare all your intended Helm chart “releases” in a single file called a “helmfile”. You then run the Helmfile command line tool to parse your “helmfile” and automatically handle invoking the appropriate Helm install or upgrade command for each of your declared “releases”. The great thing about Helmfile is that it treats each “helmfile” as a golang template (just like Helm charts + sprig functions) and supports some very sophisticated organizational constructs like “environments” and its own set of “state values” which enable you to do just about anything you can imagine.

Another great thing about the Helmfile project is that is has a great community of maintainers and is very, very active! Github issues are attended to quite rapidly, fixes are released nearly daily, and the Helmfile team is very open to new ideas, adding features to meet users requirements and is super engaged.

Use case

In previous articles we laid out the ground work for two generic Helm charts I developed for both deploying applications ( appdeploy) and likewise managing how traffic reaches those deployments ( appconduits).

After creating the above charts the use-case that I’ve previously described above became quite apparent and this is how I came across the Helmfile tool. Since that time I ended up creating helmfile-deploy as a small highly opinionated Helmfile based framework that is centered around both the appdeploy and appconduits Helm charts. The helmfile-deploy project provides two “helmfiles” that consume a simplified higher level YAML format that lets the operator convey the desired state for applications that is compatible w/ the aforementioned charts. The “helmfiles” are highly dynamic and really show some of the powerful capabilities that Helmfile brings to the table to generate custom Helm chart releases based on your own custom way of expressing that via YAML. Throughout the course of development the Helmfile team was very responsive in adding both features and quickly fixing bugs my use-cases evolved.

Check it out at: https://github.com/bitsofinfo/helmfile-deploy

Hopefully this might inspire you to give Helmfile a look.

Originally published at http://bitsofinfo.wordpress.com on July 15, 2019.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store