#helmfile - November 2018

November 2018
erik
erikalmost 8 years ago
@Erik Osterman (Cloud Posse) has joined the channel
erik
erikalmost 8 years ago
set the channel description: Questions and discussion around helmfile https://github.com/roboll/helmfile
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
@Andriy Knysh (Cloud Posse) has joined the channel
Max Moon
Max Moonalmost 8 years ago
@Max Moon has joined the channel
Daren
Darenalmost 8 years ago
@Daren has joined the channel
Michal Matyjek
Michal Matyjekalmost 8 years ago
@Michal Matyjek has joined the channel
mumoshu
mumoshualmost 8 years ago
@mumoshu has joined the channel
Shane
Shanealmost 8 years ago
@Shane has joined the channel
nian
nianalmost 8 years ago
@nian has joined the channel
erik
erikalmost 8 years ago
set the channel description: Questions and discussion around helmfile https://github.com/roboll/helmfile and https://github.com/cloudposse/helmfiles
mallen
mallenalmost 8 years ago
@mallen has joined the channel
davidvasandani
davidvasandanialmost 8 years ago
@davidvasandani has joined the channel
mumoshu
mumoshualmost 8 years ago
hi @Erik Osterman (Cloud Posse) @Andriy Knysh (Cloud Posse) @Shane happy to chat with you here!
mumoshu
mumoshualmost 8 years ago(edited)
@Shane I think I may have same feeling as yours. One thing is the sub-helmfiles feature. atlantis arrived in the landscape, making me think I have no specific use-cases for sub-helmfiles. It seems like a matter of splitting a helmfile.yaml into multiple independent ones, atlantis could sync everything or only part of helmfiles.

My main concern is all of the ways that helmfile works... so many usecases have been added that supporting it all proves painful.
mumoshu
mumoshualmost 8 years ago
and sub-helmfiles introduced much confusion to users, like "how to use global variables" and "how to share variables across helmfiles", "how to pass arguments only to a subset of sub-helmfiles" and so on 😩
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
hi @mumoshu
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
i agree that’s not an easy thing to do
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
what we used, instead of having sub-helmfiles, we targeted a particular chart helmfile --file helmfile.yaml --selector namespace=kube-system,chart=prometheus-operator sync, or a group of charts by their labels
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago(edited)
maybe that will work (with atlantis)?
mumoshu
mumoshualmost 8 years ago
@Andriy Knysh (Cloud Posse) i believe that would almost work
mumoshu
mumoshualmost 8 years ago
atlantis doesnt allow specifying arbitrary args at runtime. so how to handle helmfile args like --file helmfile.yaml --selector namespace=kube-system,chart=prometheus-operator seems the issue for me
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
we can change atlantis 🙂 we already forked it here https://github.com/cloudposse/atlantis and added a few new features https://github.com/cloudposse/atlantis/releases
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
but sure, this is not a long term solution
mumoshu
mumoshualmost 8 years ago
atlantis does support changing directory before running plan or apply via -d DIR flag. so i was in an impression that splitting your helmfile.yaml by what you use in selectors, and giving each helmfile an independent directory works nicely with atlantis.
mumoshu
mumoshualmost 8 years ago
so that altlantis could detect and run helmfile sync against the namespace=kube-system,chart=prometheus-operator part of your former helmfile.yaml, if that was the only changed helmfile.yaml in your project.
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
ah yes, change detection would be a challenge with one file, agree
mumoshu
mumoshualmost 8 years ago
ya! that's definitely a way to make it work. think im just trying to align as much as possible with current atlantis' design, so that we don't diverge from the upstream too far
mumoshu
mumoshualmost 8 years ago

change detection would be a challenge with one file


yeah, this!
mumoshu
mumoshualmost 8 years ago
at the time of implementing the most of helmfile's feature, there was no atlantis. i wanted helmfile to detect changes and only update necessary helm releases. that is helmfile diff and helmfile apply.
mumoshu
mumoshualmost 8 years ago
but i wonder, in a normal circumstance, if it would be nicer if we could detect changes more efficiently, without running helmfile diff.

atlantis basically seems to do a kind of git-diff to detect changes, with would indeed faster than helmfile diff ... 🙂

helmfile diff is superior though, because it allows us to detect configuration drifts.
mumoshu
mumoshualmost 8 years ago
im not yet sure how we should set up our overall workflow. atlantis plan would run helmfile diff against only changed helmfile.yamls. atlantis apply would run helmfile apply against only changed helmfile.yamls. what for configuration drift detetion?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
what atlantis does is it calls the API (GitHub for example) and the API returns a list of changed files
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
so if helmfile supported sub-files, there would be no difference in the detection flow
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
from this point of view, it would be the easiest solution. Any changes in a sub-helmfile would trigger plan/apply
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
@mumoshu what configuration drifts are you thinking of?
mumoshu
mumoshualmost 8 years ago
thx for the info! never realized github api allowed that
mumoshu
mumoshualmost 8 years ago
i was thinking of e.g. my colleague manually upgraded one of helm releases by hand
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
ah that one
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
it’s not easy i guess
mumoshu
mumoshualmost 8 years ago
yes i think so too
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
b/c there would be no changed files
mumoshu
mumoshualmost 8 years ago
helmfile doesn't know about helm releases not defined in helmfile.yaml, in the first place. so configuration drift detection by helmfile isn't perfect
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
(don’t allow your colleagues to do anything manually 🙂 )
mumoshu
mumoshualmost 8 years ago
yes, that
mumoshu
mumoshualmost 8 years ago
true! 😆
mumoshu
mumoshualmost 8 years ago
one idea is that running an external tool to detect all the helm releases that aren't defined in helmfile.yamls while beating its authors. then helmfile could do the rest with your suggested setup of helmfile sync being run whenever one of subhelmfiles changed
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
in helmfile, do you use something like state-file as Terraform does?
mumoshu
mumoshualmost 8 years ago
nope. but i had an idea like that
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
yes, TF uses it and just compares what you have in code with the state from the state file
mumoshu
mumoshualmost 8 years ago
i thought i have discussed about the state thing here https://github.com/roboll/helmfile/issues/194#issuecomment-406458671

basically we wanted not to introduce an external state store at that time
mumoshu
mumoshualmost 8 years ago
ah, in that sense, helm releases are already stored in k8s as secrets or configmaps
mumoshu
mumoshualmost 8 years ago
so you do have the state
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
understandable… it’s a project in itself and not easy
mumoshu
mumoshualmost 8 years ago
helmfile diff renders releases locally and compare with the remote state(=helm releases stored by helm in the cluster)
mumoshu
mumoshualmost 8 years ago
yeah i think so..
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
so if I change a helmfile on GitHub, atlantis will detect it, then helmfile diff would do the trick?
mumoshu
mumoshualmost 8 years ago
yep. it will detect any changes as long as the helm releases are listed under helmfile.yaml's releases:
mumoshu
mumoshualmost 8 years ago
but if your change was removing a single release from releases:, helmfile diff detects nothing
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
so the only thing that’s missing is to support sub-helmfiles? I saw something about it in the repo. How far are you from implementing it?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago

but if your change was removing a single release from releases:, helmfile diff detects nothing
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
yea, that’s why state file like TF’s would help here
mumoshu
mumoshualmost 8 years ago
agreed
mumoshu
mumoshualmost 8 years ago
ah i remember that i have once proposed helm to allow tagging helm releases
mumoshu
mumoshualmost 8 years ago
so that we can tag helm releases with something like managed-by=helmfile, which allows helmfile to detect releases removed from helmfile.yml
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
yea, that would work too
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago(edited)
and easier than maintaining external state with all its syncing and locking
mumoshu
mumoshualmost 8 years ago
btw the `sub-helmfiles feature is already implemented. it is just that (i think) it has many edge-cases to use properly > https://sweetops.slack.com/archives/CE5NGCB9Q/p1542436482007600
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago(edited)
hmm, i think we never saw any of those issues
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
can you show an example of any of the edge-cases?
mumoshu
mumoshualmost 8 years ago
just dumping options i have in my mind.

option 1: helmfile.yaml + sub-helmfiles + atlantis + external unmanaged helm release detector => almost works, but sub-helmfiles seems to be hard to use

option 2: independent helmfile.yaml + atlantis + external detector => how can we detect config drifts? use find . -name helmfile.yaml | xargs helmfile apply -f {} \; for atlantis apply?

option 3: basically option 1 with all the sub-helmfiles merged into the top-level one => have not thought much about this yet
mumoshu
mumoshualmost 8 years ago
sure, hold on..
mumoshu
mumoshualmost 8 years ago
https://github.com/roboll/helmfile/issues/388
https://github.com/roboll/helmfile/issues/361 (should they propagate to sub-helmfiles?)
https://github.com/roboll/helmfile/issues/344 (use a specific selector for sub-helmfiles only)
mumoshu
mumoshualmost 8 years ago
i'll add once i find more
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
thanks, I’ll take a look
Alexander Tolstikov
Alexander Tolstikovalmost 8 years ago
@Alexander Tolstikov has joined the channel
Shane
Shanealmost 8 years ago
One issue I see is with atlantis if I'm not mistaken it expects all configuration for a thing to be in the directory. In the helm file situation changes in a directory above helmfile could effect releases in a different location. I also see "globals" as part of a problem that I currently have as changing a global effects all environments which is overall a bad design, but I'm part of the problem 🙂
Shane
Shanealmost 8 years ago
With terraform it's easy to create modules that contain those defaults, but with helm creating a new chart just to wrap a existing chart is a unpleasant undertaking.
Anmol
Anmolalmost 8 years ago
@Anmol has joined the channel
mumoshu
mumoshualmost 8 years ago(edited)
@Shane If I read correctly, your concern is about "how to trigger helmfile sync against dir/helmfile.yaml if affecting changes are made outside of the dir/", right?
mumoshu
mumoshualmost 8 years ago(edited)
For that, I'm about to give up elegantly handling it...

Validate or just encourage people, so that all the deps to dir/helmfile.yaml are collocated inside dir/. No sub-helmfiles or values files in nested or sibling directories.

This is basically the option 3 shown in my above comment.
mumoshu
mumoshualmost 8 years ago
Btw, here's my initial attempt to add the nice-to-have feature to atlantis, that would enable atlantis to accept custom commands(or comment-command or stage in atlantis terminology)

https://github.com/cloudposse/atlantis/pull/20

apprecite any feedback. im still unfamiliar with atlantis
Shane
Shanealmost 8 years ago
That would still require you syncing everything in the helmfile or at least doing apply.
Shane
Shanealmost 8 years ago
Although I guess that is pretty much the same thing that is happening in terraform
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
@mumoshu thanks, reviewed your PR, LGTM
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
if you think it’s OK, we can merge to cloudposse/atlantis
mumoshu
mumoshualmost 8 years ago

That would still require you syncing everything in the helmfile or at least doing apply.


@Shane thanks for the res. yep. so in other words, you shouldn't use helmfile [sync|apply] -l foo=bar, right?
mumoshu
mumoshualmost 8 years ago
other than that, i'd also like we could run a kind of helmfile apply against the whole cluster, so that we can detect any release that aren't defined by any helmfile.yaml.

rel: https://sweetops.slack.com/archives/CE5NGCB9Q/p1542438629036000
https://sweetops.slack.com/archives/CE5NGCB9Q/p1542439119045900
mumoshu
mumoshualmost 8 years ago
@Andriy Knysh (Cloud Posse) thx for the review! i'll double-check and proceed once done
joshmyers
joshmyersalmost 8 years ago
@joshmyers has joined the channel
No earlier messagesBrowse by dateDecember 2018