#helmfile (2022-05)

https://github.com/helmfile/helmfile

Questions and discussion around helmfile https://github.com/roboll/helmfile and https://github.com/cloudposse/helmfiles

Archive: https://archive.sweetops.com/helmfile/

2022-05-04

el avatar

I’m using helmfile to install a chart that I’ve written myself. Currently, I keep all of my values files in the same directory as my helmfile.yaml, and the chart itself has no values files (just templates/ and a Chart.yaml ).

Should some of the values live in the helm chart, or does it make sense to keep them all alongside the helmfile like I’m currently doing?

bradym avatar

I think it depends on how you’re using the chart. I have a chart we use for deploying a bunch of different apps, and the chart has a values file with default values.

Then I have a folder of values files with a file for each app. In those values files I only stuff that is different from what’s in the chart’s values.yaml file.

I like this approach as it makes it easy to see what things can be customized by looking at the chart’s values.yaml file.

bradym avatar

The other thing I like about having a values file in the chart is with this vscode extension I can get autocomplete for stuff in values.yaml.

https://marketplace.visualstudio.com/items?itemName=Tim-Koehler.helm-intellisense

Helm Intellisense - Visual Studio Marketplace

Extension for Visual Studio Code - This extension provides intellisense for helm templates

1
el avatar

very cool, thanks for the insight! and for sharing that extension, that’s really cool

bradym avatar

I don’t claim that the way I’m doing it is the “right way” by any means, just that it’s what we do and it’s working for us.

el avatar

yeah it seems like there is no right way so that’s helpful to hear

el avatar

I’m keeping a separate values file per application, just at the helmfile level rather than the chart level

bradym avatar

helmfile seems to be an interesting mix of “do what you want” and “no, that’s not how you do that thing.”

1
el avatar

yeah. I think the hardest part for me is that

1) helm documentation is so-so 2) a lot of helm’s functionality depends on understanding Go templating, as well as Sprig functions 3) helmfile has a ton of overlap with helm and it’s hard to see the differences and when to use what

el avatar

It would be really helpful to have a “common practices” guide for Helm rather than “here ya go, good luck”

1
tim.j.birkett avatar
tim.j.birkett

A chart should generally always have a default values.yaml within it that can be used with tools like helm-docs to document the chart’s interface (how people can use it and override things). All values are easily overridable by passing in your own customisations helm ... -f ... or helm ... --set ... (or values set or loaded in helmfile )- basically aim to be able to helm template your chart with no inputs and get something sensible out.

https://helm.sh/docs/chart_template_guide/getting_started/#charts

Getting Started

A quick guide on Chart templates.

1
tim.j.birkett avatar
tim.j.birkett

Also, if things are simple enough, the raw chart is a good option: https://github.com/helm/charts/tree/master/incubator/raw - although over-use of it, or trying to create an application deployment from it is probably a “smell”.

el avatar

Thanks @tim.j.birkett! I hadn’t thought of the chart’s values.yaml documenting the interface, which is super important. I also didn’t know about helm-docs so thanks for sharing

tim.j.birkett avatar
tim.j.birkett

No problem I’ve recently been neck deep in YAML and sprig/go templating and implementing lots of things like chart “auditing” with https://github.com/FairwindsOps/polaris and helm unit testing… all good fun… and YAML.

FairwindsOps/polaris

Validation of best practices in your Kubernetes clusters

1

2022-05-05

2022-05-06

Jaivarsan B avatar
Jaivarsan B

hello new here :wave:

so im here particularly seeking a special alternative to helm upgrade --recreate-pods which got removed in helm3. issue but helmfile seems to be supporting in the helmfile.yaml , example code

recreatePods: true

does that work for helm3 , if yes how? the source code in pkg/state/state.go is just passing on the flag, and not doing anything else. it won’t work with helm 3 right? it doesn’t when i do from helm3 ‘s cli.

the actual problem im trying to solve is, in case if you can help this directly: • im creating helm-as-a-service (by wrapping helm3 binary behind a fastapi server), for deployments via API. similar to this and this project, where there’d be frequent need to refresh, soft-restart (graceful replace old with new) the pods by pulling fresh image and doing rollout and no values.yaml changes. ◦ if you thought kubectl rollout restart svc/blah-blah would work, im thinking same. but helm install release chart ‘s release and chart name exactly don’t match the kubectl pod name. also there might be lot of too many pod replicas and pod dependencies as well.

• the best thing i could have is: ◦ 1. helm command for soft-restarting a release (with chart dependencies) ◦ 2. helm command for soft-restarting a release (without chart dependencies). but they don’t exist.

thanks if you read this far!

prashanttiwari1337 avatar
prashanttiwari1337

So you want pods to recreate when you do helm upgrade? Can you check UpgradeStrategy value in values.yaml. If it is OnDelete then change it to RollingUpdate. That should be able to recreate the pod with each helm upgrade

2022-05-07

sohaibahmed98 avatar
sohaibahmed98
appvia/tf2helm

Converts a Terraform module to a Helm Chart

2022-05-11

Andrew Nazarov avatar
Andrew Nazarov

I’ve noticed that the latest version of helmfile in roboll/helmfile is 0.144.0 whereas in helmfile/helmfile it’s 0.143.4. @mumoshu What would be the harmonisation process? Will we have the continuation of the existing versions in helmfile/helmfile or what is the release strategy? Thanks!

mumoshu avatar
mumoshu

oh well let me check what’s going on… but my intention is that roboll/helmfile will ever have new releases anymore, and it’s never intended to go ahead of helmfile/helmfile

Andrew Nazarov avatar
Andrew Nazarov

Ok, if I use curl I can download version 0.144.0 of helmfile/helmfile

Andrew Nazarov avatar
Andrew Nazarov

But somehow it’s not presented in tags.

mumoshu avatar
mumoshu

im a little confused but we have never replicated any releases in roboll/helmfile into helmfile/helmfile so if you’re trying to download any release assets from helmfile/helmfile, it won’t work(as they are inexistent

Andrew Nazarov avatar
Andrew Nazarov

I don’t think that roboll/helmfile went ahead of helmfile/helmfile. It’s just some issue with a few later tags

mumoshu avatar
mumoshu

and we’ve never released anything since our move to helmfile/helmfile. so once we cut a new release(it’s very likely to be 0.145.0), you’ll see it in helmfile/helmfile, but not in roboll/helmfiel

mumoshu avatar
mumoshu

before that, you’ll see no releases in helmfile/helmfile.

Andrew Nazarov avatar
Andrew Nazarov

And I’m curious what the release policy would be for helmfile/helmfile

mumoshu avatar
mumoshu

haven’t decided yet. i tend to release very often but nowadays other maintainers are very active and adds many fixes in a short period so i missed the timing to cut a release..

1
mumoshu avatar
mumoshu

re: releases in helmfile/helmfile- i have not planned to replicate historical releases to helmfile/helmfile. do you need it?

Andrew Nazarov avatar
Andrew Nazarov


re: releases in helmfile/helmfile- i have not planned to replicate historical releases to helmfile/helmfile. do you need it?
No, just curious:) We are switching repos in our build scripts. We can wait for the newer release of helmfile/helmile. It’s not a problem)

mumoshu avatar
mumoshu

gotcha, thanks for clarification!

1
Ievgenii Shepeliuk avatar
Ievgenii Shepeliuk

Jumping in, but isn’t it a good time to start with 1.0.0 ? I see a repeatable pattern when people deliberately avoid adopting/assessing helmfile because the version is zero something and the README says early stage of development.

Andrew Nazarov avatar
Andrew Nazarov

Agree. We’ve been using helmfile for more that 3 years already. In production for almost 3 and consider it quite stable and reliable.

mumoshu avatar
mumoshu

I thought we had a few issues that might result in breaking changes which will be super difficult to introduce after v1 but yeah… perhaps we can give up at mark it v1

mumoshu avatar
mumoshu

This is going to be pinned to the header of our GitHub issues list so that everyone can be aware of and redirected to important planned features for discussion :)

• Allow opting in for inheriting all the values to sub-helmfile #762 • Add option for remote values files located in other repos #469 • Stop bases inheriting parents’ values by default #688 • Automated rollback of failed release #256 • Atomic helmfile release #925 • Installing a helm release from single K8s manifest YAML file hosted somewhere (e.g. OperatorHub) #1720 • Remove helmfile –args #1804 • Add --dry-run #118 • Add {{ include }} #1345 • Let double-rendering go #932 • Stop helmfile on first error #1977 • A flag to render subchart notes #2001 • Disallow layering valuesTemplates + values #2037 • Ability to set release values via helmfile flag #2049

mumoshu avatar
mumoshu

hm, maybe the only breaking change listed there would be https://github.com/roboll/helmfile/issues/688

Extracted from #347 (comment)

We’ve introduced bases a month ago via #587. I’d like to make this breaking change(perhaps the first, intended breaking change in helmfile) before too many people start using it :)

Ievgenii Shepeliuk avatar
Ievgenii Shepeliuk

Well, the version is a minor issue - but what about just removing from README

> Even though Helmfile is used in production environments across multiple organizations, it is still in its early stage of development, hence versioned 0.x.

mumoshu avatar
mumoshu

that’s indeed a good idea! what if it looked like

“Even though Helmfile is versioned pre-1.0, it’s already used in production environments across multiple organizations for more than 3 years. We’ev made only a few breaking changes so far and there’s only 1 planned minor breaking change today..”

Ievgenii Shepeliuk avatar
Ievgenii Shepeliuk

Much better IMO

2022-05-12

Andrew Nazarov avatar
Andrew Nazarov

Can’t find if there is a possibility in helmfile to create a helm release out of remote plain kubernetes manifests. As far as I remember there were some discussions regarding variantdev/chartify, however since there is no readme there I can’t recall if I’m on the right track. Some features were definitely added to helmfile, though I can’t find anything except for working with kustomizations. Am I missing something?

Peter Aichinger avatar
Peter Aichinger

Just a short question: Is it possible to have needs between releases defined in separate sub-helmfiles?

2022-05-13

2022-05-14

mr.shayv avatar
mr.shayv

Is it possible to insert the current FQDN of the node I’m currently executing the helm chart install on inside the templates helm chart?

el avatar

If the FQDN is set as an environment variable you should be able to use that in your helm chart. Otherwise, you would have to set it as an env var before installing the chart

2022-05-16

Dan Merino avatar
Dan Merino

are there any high-level goals for documentation for this project? i’ve started implementing this at my workplace and while there’s a ton of functionality, some of the documentation is outdated or hard to find. i’d be glad to contribute to this, but want to know if there’s any existing goals for this already

Rene Hernandez avatar
Rene Hernandez

We have been making progress on that https://helmfile.readthedocs.io/en/latest/

1
Rene Hernandez avatar
Rene Hernandez

We welcome suggestions and contributions

2022-05-17

steenhoven avatar
steenhoven

Does anyone have a good explanation on helm and helmfile for beginners?

I’m willing to create something, but not if it’s already done

Ievgenii Shepeliuk avatar
Ievgenii Shepeliuk

what kind of explanation do you need ? step by step installation guide ?

steenhoven avatar
steenhoven

What it functionally does and why you might want helm and helmfile.

Manjunath shetty avatar
Manjunath shetty

Hi , In my application each micro service has different livenessProbe configuration. is there any way to pass complete livenessProbe configuration from values.yaml to deployment template file?

Andrew Nazarov avatar
Andrew Nazarov

You can do it with toYaml function

Manjunath shetty avatar
Manjunath shetty

Thanks Andrew.

2022-05-18

Steven Miller avatar
Steven Miller

What does CloudPosse use by default for k8s ingress controller?

Steven Miller avatar
Steven Miller

Hmm wrong channel, asking in #kubernetes

joshua s avatar
joshua s

what’s the best way to install something like the knative-operator that doesn’t have a helm chart? official knative docs push users to manually apply

kubectl apply -f <https://github.com/knative/operator/releases/download/knative-v1.4.1/operator.yaml>

helmfile hooks look messy. trying to find an example of “Ability to install a directory of K8s manifests as a chart” as mentioned in this PR

steenhoven avatar
steenhoven

I use the raw chart for this, but its not super ideal.

2022-05-19

Manjunath shetty avatar
Manjunath shetty

Hi , my project consists of 11 micro services . we have created templates and helmfile to deploy. Total we have 11 values.yaml corresponding to 11 releases in the helmfile per environment. we want to build ci/cd to deploy into multiple environments sequentially . What is best approach we can follow to deploy into multiple environments?

Stephen Tan avatar
Stephen Tan

this sounds like an Interview question

Manjunath shetty avatar
Manjunath shetty

indeed

Manjunath shetty avatar
Manjunath shetty

Actually I know few scenarios like 1. defining multiple helm file (each per environment) 2.defining environments in a single helm file (conditionally call values.yaml based on env) 3.define single helm file with all the releases required for different env(not a good practice ) . In all of this approaches we need to use 33 values.yaml file (based on each service). Looking for any better alternatives available

Andrew Nazarov avatar
Andrew Nazarov

You can have only one values.yaml file per environment if you have all releases defined in one helmfile and utilise the environments: feature. It depends. Helmfile is not that opinionated, there are many ways to do things and a lot of flexibility even if you find it lacks some functionality.

Manjunath shetty avatar
Manjunath shetty

you mean one values.yaml per microservice ?

Manjunath shetty avatar
Manjunath shetty

or one values.yaml for all the microservices?

Andrew Nazarov avatar
Andrew Nazarov


or one values.yaml for all the microservices?
this

yxxhero avatar
yxxhero
helmfiles:
{{- if (.Values | get "enable_test_secret" true) }}
  - path: releases/-secrets/helmfile.yaml
{{- end }}

Excuse me. is it right? Thanks very much. it is in main helmfile.

steenhoven avatar
steenhoven

ture?

yxxhero avatar
yxxhero

fix

tim.j.birkett avatar
tim.j.birkett

Wouldn’t it just be:

helmfiles:
{{- if .Values.enable_test_secret }}
  - path: releases/-secrets/helmfile.yaml
{{- end }}
steenhoven avatar
steenhoven

Yep. AFAIK.

Andrew Nazarov avatar
Andrew Nazarov
{{- if (.Values | get "enable_test_secret" true) }}

get here might be useful when you don’t have a key defined in values and you can set the default value if it’s not defined.

1
yxxhero avatar
yxxhero

@Andrew Nazarov Thanks very much.

2022-05-20

2022-05-26

2022-05-31

Mark Glants avatar
Mark Glants

Hi there how to template helmfile so it will check is it first install or upgrade

Balazs Varga avatar
Balazs Varga

you can template wih helmfile template but that won’t check the diff between local and installed… we use diff helm plugin to get the difference with helmfile diff. is that what you are looking for?

Mark Glants avatar
Mark Glants

So i have migrations and test dataset

Mark Glants avatar
Mark Glants

migration can apply on each release

Mark Glants avatar
Mark Glants

but dataset could be used just on first install

Mark Glants avatar
Mark Glants

so for example if migration release doesn’t exists values.args: dataset will be used, if it’s an update values.args: migration will be used

Mark Glants avatar
Mark Glants

So i just write helmfile apply

Mark Glants avatar
Mark Glants

and if release already installed it just skips\

Mark Glants avatar
Mark Glants

Release.IsInstall

Mark Glants avatar
Mark Glants

my solution

Balazs Varga avatar
Balazs Varga

we do this with diff helm plugin… everytime if you run an apply then it will check and look for changes. if it change then deploy the modification if not changed, then skip that part.

Mark Glants avatar
Mark Glants

@Balazs Varga can you share example?

Mark Glants avatar
Mark Glants

<.Release.Revision>: can’t evaluate field Revision in type state.releaseTemplateDataRelease

Mark Glants avatar
Mark Glants

<.Release.Revision>: can’t evaluate field Revision in type state.releaseTemplateDataRelease Any how i can get Relese.Revision from helmfile to manipulate with args?

    keyboard_arrow_up