#helmfile (2022-05)
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
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?
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.
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
Extension for Visual Studio Code - This extension provides intellisense for helm templates
very cool, thanks for the insight! and for sharing that extension, that’s really cool
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.
yeah it seems like there is no right way so that’s helpful to hear
I’m keeping a separate values file per application, just at the helmfile level rather than the chart level
helmfile seems to be an interesting mix of “do what you want” and “no, that’s not how you do that thing.”
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
It would be really helpful to have a “common practices” guide for Helm rather than “here ya go, good luck”
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
A quick guide on Chart templates.
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”.
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
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.
Validation of best practices in your Kubernetes clusters
2022-05-05
2022-05-06
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!
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
Converts a Terraform module to a Helm Chart
2022-05-11
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!
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
Ok, if I use curl I can download version 0.144.0 of helmfile/helmfile
But somehow it’s not presented in tags.
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
I don’t think that roboll/helmfile went ahead of helmfile/helmfile. It’s just some issue with a few later tags
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
before that, you’ll see no releases in helmfile/helmfile.
And I’m curious what the release policy would be for helmfile/helmfile
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..
re: releases in helmfile/helmfile- i have not planned to replicate historical releases to helmfile/helmfile. do you need it?
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)
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.
Agree. We’ve been using helmfile for more that 3 years already. In production for almost 3 and consider it quite stable and reliable.
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
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
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 :)
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.
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..”
Much better IMO
2022-05-12
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?
Just a short question: Is it possible to have needs between releases defined in separate sub-helmfiles?
2022-05-13
2022-05-14
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?
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
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
We have been making progress on that https://helmfile.readthedocs.io/en/latest/
None
We welcome suggestions and contributions
2022-05-17
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
what kind of explanation do you need ? step by step installation guide ?
What it functionally does and why you might want helm and helmfile.
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?
You can do it with toYaml
function
Thanks Andrew.
2022-05-18
What does CloudPosse use by default for k8s ingress controller?
Hmm wrong channel, asking in #kubernetes
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
I use the raw chart for this, but its not super ideal.
2022-05-19
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?
this sounds like an Interview question
indeed
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
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.
you mean one values.yaml per microservice ?
or one values.yaml for all the microservices?
or one values.yaml for all the microservices?
this
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.
ture
?
fix
Wouldn’t it just be:
helmfiles:
{{- if .Values.enable_test_secret }}
- path: releases/-secrets/helmfile.yaml
{{- end }}
Yep. AFAIK.
{{- 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.
@Andrew Nazarov Thanks very much.
2022-05-20
2022-05-26
2022-05-31
Hi there how to template helmfile so it will check is it first install or upgrade
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?
So i have migrations and test dataset
migration can apply on each release
but dataset could be used just on first install
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
So i just write helmfile apply
and if release already installed it just skips\
Release.IsInstall
my solution
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.
@Balazs Varga can you share example?
<.Release.Revision>: can’t evaluate field Revision in type state.releaseTemplateDataRelease
<.Release.Revision>: can’t evaluate field Revision in type state.releaseTemplateDataRelease Any how i can get Relese.Revision from helmfile to manipulate with args?