#helmfile - March 2019

mumoshu
mumoshuover 7 years ago
FYI: Use raw/incubator to add adhoc templated resources to your helm release 🙂

https://github.com/roboll/helmfile/issues/494#issuecomment-474697430
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Yes love that chart!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
We use it too
mumoshu
mumoshuover 7 years ago
I think I've firstly discovered the chart reading your commits made somewhere in cloudposse-related repo 🙂 thx about that
mumoshu
mumoshuover 7 years ago
i've added templates setting to the chart just now, which helps creating an adhoc chart thats creates a k8s secret with helm-secrets https://github.com/mumoshu/charts/blob/56d5b63d2998bcd519b52639b586d896b9016633/incubator/raw/README.md#templated-resources
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Brilliant!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@Igor Rodionov ☝️
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
So this came up again this week. We are now running Helmfile under Atlantis for a customer
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
For now, we are downloading a tarball from
GitHub, but would love to do remote sources
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Thinking maybe to have @Andriy Knysh (Cloud Posse) submit a PR
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Any suggestions for him?
mumoshu
mumoshuover 7 years ago
I think we have potential need to support a lot of sources
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Our objective is to version pin Helmfiles like we do terraform modules
mumoshu
mumoshuover 7 years ago
Sounds great 👍️
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
The risk is of course it is incompatible with some capabilities of Helmfile
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Is that acceptable?
mumoshu
mumoshuover 7 years ago
Do you have any concrete example(s) about the incompatibility? (I had none
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
No... not immediately
erik
erikover 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
This was what I was thinking of...
mumoshu
mumoshuover 7 years ago
Let me recall..
mumoshu
mumoshuover 7 years ago
Anyway, what I think recently is: We generally need abilities to (1)pin and (2)update any dependencies. a semver in the source spec, and a command to fetch the latest ver that accomodates the version constraint would be useful
mumoshu
mumoshuover 7 years ago
after that, we can add any datasource users want...
mumoshu
mumoshuover 7 years ago
as long as it supports version pinning and updating based on semver
mumoshu
mumoshuover 7 years ago
anydep was my attempt to achieve that https://github.com/mumoshu/anydep
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Oh yes, I recall you mentioning this to me
mumoshu
mumoshuover 7 years ago
@Erik Osterman (Cloud Posse) Can I add a link to this channel in the helmfile readme? 🙂
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@mumoshu please do!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
We also have an archive of the channel publicly available here: https://archive.sweetops.com/helmfile/
Shane
Shaneover 7 years ago
@mumoshu or anyone else I'm getting more interested in this or something similar due to some requests from my teams - https://github.com/roboll/helmfile/issues/483
Shane
Shaneover 7 years ago
If we could decide on a design that also achieves what I need to do I can probably do the PR.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
I think a locking mechanism with helm is desperately needed
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
i think a locking mechanism in helmfile would help, but where we need it most is when we deploy our own apps, which can happen dozens of times a day
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
(E.g. unlimited staging environments)
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
the problem is if helm is executed twice in short succession to “upgade” an environment, the outcome is unpredictable
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
we use helmfile for those deployments as well, however the pipeline is different
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
and the pipeline isn’t always executed by atlantis; sometime codefresh
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
so I see the actual fix as being some kind of locking mechanism that is in k8s ,not on the filesystem
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@Shane ☝️
Shane
Shaneover 7 years ago
a helm upgrade is predictable if you don't run repo update
Shane
Shaneover 7 years ago
but ya in codefresh you would need to get a new index
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
to concurrent helm upgrades on the same release is predictable?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
where is the locking happening?
Shane
Shaneover 7 years ago
Whenever we run helm standalone we always specify a version so we don't have your issues.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
e.g. helm upgrade --wait, i see that affected
Shane
Shaneover 7 years ago
interesting never had a usecase for a concurrent upgrade against the same helm release
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
one upgrade starts before the other one finishes and they both are in --wait state
Shane
Shaneover 7 years ago
ahh ya, that's an entirely different issue than what a lockfile would accomplish
Shane
Shaneover 7 years ago
You want helm to block.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
(or helmfile)
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
but in a distributed manner
Shane
Shaneover 7 years ago
That will also be a issue with helm v3
Shane
Shaneover 7 years ago
I do agree a change lock should be available.
Shane
Shaneover 7 years ago
which would only make sense inside of k8s
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
we do all our app deploys also with helmfile; we call it the “helm cartridge” strategy. basically with every app, we ship a helmfile.yaml inside of it that describes how to deploy the app.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
“inside of it” = “inside of the docker image”
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
-----
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
that said, i don’t personally have any complaints about adding a lock file 😃
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
…and we’ll probably use the flag if it exists
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
just it doesn’t solve all our headaches
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
-------
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
I think what would solve our problems is terraform-helmfile-provider
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
then we can piggy back on all the capabilities of terraform
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
and all the power/flexibility of helmfile
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
and we’d get locking to boot (since terraform already supports state locking)
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@mumoshu first planted this seed in my head
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@Shane how’s that for a weekend project? 😃
Shane
Shaneover 7 years ago
haha
Shane
Shaneover 7 years ago
terraform solves your locking problem, but I personally don't know if I see the value in other things terraform can do.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
soooooo what about creating that IAM role for your service so it can write to S3
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
what about creating that DNS zone for your external-dns
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
what about creating that ElasticSearch cluster for your kibana UI
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
it’s interesting if we can provision the backing services needed to deploy things in k8s
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
k8s handles a very narrow slice of automation, the rest is handled by tf
erik
erikover 7 years ago
erik
erikover 7 years ago
erik
erikover 7 years ago
erik
erikover 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
there are a few examples of where we wrote the terraform modules for provisioning the backing services needed by apps deployed with `helmfile
Shane
Shaneover 7 years ago
Sure, but no specific reason to couple terraform infrastructure and terraform for services. You certainly can, but does not mean they need to be in one location.
Shane
Shaneover 7 years ago(edited)
Essentially we have a process that runs terraform and a second process that runs helmfile.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
yea, we do something similar
Shane
Shaneover 7 years ago
certainly coupling them is another option.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
just orchestrating the relationships between them is not “solved”
Shane
Shaneover 7 years ago
But from our design I don't view it as preferred to couple them.
Shane
Shaneover 7 years ago
If anything I would rather helmfile pull from a terraform state output.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
what do you think about Terraform Operators?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
(experimental)
Shane
Shaneover 7 years ago
I think they are a massive ton of work to actually get functional
Shane
Shaneover 7 years ago
due to all of the migration edge cases where it would destroy your infrastructure.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
lol
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
yes
Shane
Shaneover 7 years ago
I essentially wrote one for provisioning kubernetes, rds, s3 and a few other resources at my last job.
Shane
Shaneover 7 years ago
It was essentially a operator to provision cloud resources for our platform
Shane
Shaneover 7 years ago
It was .....painful
Shane
Shaneover 7 years ago
We essentially used terraform in the background, but we had to have specific migration plans when terraform was not backwards compatible between 2 versions.
Shane
Shaneover 7 years ago
overall we decided that using terraform to do that type of work was a disaster for us.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
wow, interesting you already went down that path
Shane
Shaneover 7 years ago
it works fine if you have well worn modules, but it's not very good for adhoc oh I need to change X
Shane
Shaneover 7 years ago
not like you can just rename resources and apply the terraform
Shane
Shaneover 7 years ago
you will break everything at least for the time being
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
i was concerned about those points. so basically, having purpose built operators in k8s might work, but a generalized operator for tf might be impractical for the reasons you mentioned
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
purpose built operator = etcd operator, mysql operator, etc
Shane
Shaneover 7 years ago
I took a interview with these guys recently and it sounds like they are doing exactly what you are talking about just not in terraform - https://crossplane.io/
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
that looks interesting
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
I’m torn. I think what we want to achive is hard to achieve e2e in terraform
Shane
Shaneover 7 years ago
ya, they are very very early. I hope they can accomplish what they are aiming for it would be great.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
a higher order language is probably required.
Shane
Shaneover 7 years ago
ya, which is why they are not doing it in terraform as the evolution is to hard.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
have you seen them?
Shane
Shaneover 7 years ago
npe
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
they are also like cloudposse
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
more k8s focused
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
some interesting projects, all open source
Abhsihek Jaisingh
Abhsihek Jaisinghover 7 years ago
Is there any performance difference between helmfile sync & helmfile apply, like if I am using helmfile in my CI running on every commit. Which should be more preferable?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
in a CI/CD context, helmfile apply coupled with the intalled flag is the way to go
mumoshu
mumoshuover 7 years ago
shouldn't helmfile diff and helm diff hide diffs of secrets by default? please 👍️ on this issue if you agree 🙂
https://github.com/databus23/helm-diff/issues/128
mumoshu
mumoshuover 7 years ago
considering to add helmfile destroy while deprecating helmfile delete. wdyt?
https://github.com/roboll/helmfile/issues/511
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
agree about --purge
mumoshu
mumoshuover 7 years ago
thx! i'll add helmfile destroy in my next sprint on helmfile 😄
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
....which would operate only on (installed: true) ?
mumoshu
mumoshuover 7 years ago
no, i wasn't considering to do so! im interested in what would be the benefit, though
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
was thinking that was maybe the closest to terraform destroy?
mumoshu
mumoshuover 7 years ago
trying to understand
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
so "that with a state of installed should be destroyed"
mumoshu
mumoshuover 7 years ago
i'm thinking if we need ignored: true that is different than installed: true to express it
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
since the state in helmfile is not external (e.g. helmfile.state) but instead defined directly inside of the helmfile.yaml, that makes the installed state determined by installed: true
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
but yea, it gets confusing
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
just for flavor....
erik
erikover 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
terraform plan has an argument for -destroy which generates a plan to destroy
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
that's kind of like installed: false + helmfile apply
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
---
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
or another way of thinking about it:
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
helmfile apply + installed: false == helmfile destroy + installed: true
mumoshu
mumoshuover 7 years ago
that equation does help me get the idea
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
now, i don't know if that's what the community wants
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
just logically that makes sense to me
mumoshu
mumoshuover 7 years ago(edited)
so am i. and i think theres no downside of making it as such
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
the nice thing is then terraform destroy undoes exactly what was created from terraform apply
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
... which is a nice way to iterate
mumoshu
mumoshuover 7 years ago
agreed
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
you realize what you're doing.... you're making it so we can use something like https://github.com/gosuri/terraform-exec-provider
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
we could have a generic provider in terraform that calls command with apply, or destroy and maybe we can use helmfile then with terraform 😃
mumoshu
mumoshuover 7 years ago
thought if installed: true better be ignored: false or enabled: true but turned out either of them fits my mental model