#helmfile (2019-07)
Questions and discussion around helmfile https://github.com/roboll/helmfile and https://github.com/cloudposse/helmfiles
Archive: https://archive.sweetops.com/helmfile/
2019-07-11
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
One more question about {{'{{}}'}}
syntax.
Say, I set something like this in helmfile.yaml
values:
- hostname: {{`{{.Release.Namespace}}`}}.my-domain.com
But this causes the error during helmfile lint
: reading document at index 1: yaml: line 241: did not find expected key
.
Is this an expected behaviour?
Btw, I’m on quite old version: v0.69.0
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
Answering my own question. Probably somebody will find this useful. That was explained previously here: https://sweetops.slack.com/archives/CE5NGCB9Q/p1560168577052300. I wasn’t very attentive at first. But got the answer right after sending the question.
chart: {{` {{ .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }} ``}
evaluates to
chart: {{ .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }}
which looks chart: {{ whatever }}//{{ whatever }}
for the yaml parser
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
does helmfile support creation of standalone kubernetes resources? for example if i add istio as a release and want to install a gateway, but without it being contained in a helmchart
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
@Mical Helmfile just calls helm. But you’re in luck…
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
There is a “raw” chart that does exactly what you want
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Here is a example: https://github.com/cloudposse/helmfiles/blob/master/releases/external-storage.yaml
Comprehensive Distribution of Helmfiles. Works with helmfile.d
- cloudposse/helmfiles
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
And we used it also to install an istio gateway
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Here is an example of that: https://github.com/cloudposse/example-app/blob/master/deploy/releases/istio.yaml
Example application for CI/CD demonstrations of Codefresh - cloudposse/example-app
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
@Erik Osterman (Cloud Posse) thanks I’ll check it out!
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
What’s the road map for 1.0.0? We’re looking at different tools to use for decentralizing helm chart development while having a centralized way to test, package and continuously deploy systems containing a variety of charts. So far we’ve been looking at flux and helmfile. Flux is great but very opinionated while helmfile gives us the freedom of control since it is stateless. The fact that helmfile is still <1.0 is an issue for us for obvious reasons.
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
I think it’s unfair to judge based on the release version being pre 1.0. Terraform is 0.12 is in use in production by enterprises/banks/etc. Obviously the uptick in traction is a wee bit less for helmfile. From my POV, better indicators to look at is how often the software is released (aka maintained), how responsive are the maintainers to issues, the overall traction of the project/community.
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
when you look at these characteristics, then helmfile shines.
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
btw, @mumoshu has now written an HelmfileOperator
so you can do flux-like things with helmfile (that is a proof of concept though.
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Kubernetes operator that continuously syncs any set of Chart/Kustomize/Manifest fetched from S3/Git/GCS to your cluster - mumoshu/helmfile-operator
2019-07-12
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
@Erik Osterman (Cloud Posse) that’s a valid point.
2019-07-15
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Thanks Erik!
@Mical If I have anything to add, there would be only two things:
(1) Many orgs including my company uses helmfile in production
https://github.com/roboll/helmfile/blob/master/USERS.md
(2) Even though it is pre-1.0, Helmfile has never introduced breaking changes to existing feature for a year or so.
We do introduce breaking changes to experimental features but even those happen only after prior discussions with the known users of the feature.
Deploy Kubernetes Helm Charts. Contribute to roboll/helmfile development by creating an account on GitHub.
2019-07-18
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
can i get the exit code from hooks to propagate so that helmfile sync
doesn’t exit with 0 on failure?
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
hey!
generally hemlfile
exits with 1
when one of your hooks failed.
for example, running helmfile sync
against this helmfile.yaml
exists with 1
:
releases:
- name: mysql1
chart: stable/mysql
namespace: mysql
hooks:
- name: myhook
events: ["presync"]
command: "sh"
args:
- -c
- echo whatever; exit 1
does this help?
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
hm, it doesn’t exit with 1 if my helm tests fail. will try to get something that can be reproduced
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
oh. which hook events
are you using?
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
postsync
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
ah, i’ve reproduced it. perhaps i’ve made it ignore non-zero exit codes for postsync hooks for thinking it’s nice
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
i’ll take this as a chance to redesign it
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
helmfile processes your releases in parallel. do you want all the ongoing releases to be immediately canceled if one of them failed in postsync
?
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
or complete all the releases anyway and fail helmfile itself only when one or more releases failed in postsync
?
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
for me the latter would suffice, since there might be cases where you would want other releases to be processed but as long as we can tell if all passed or not i’m happy
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
but in the long run it might be nice to have that control yourself via configuration
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
Is there an easy way to patch this manually until there’s a new release available? It’s a deal breaker since I want to use helmfile
in our ci/cd pipeline and I only have 2 more weeks until vacation
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
since you said that you made it ignore non-zero i was thinking there might be an easy way to fork helmfile and make it not ignore it
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
yeah probably. i’ll take a look now!
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
thank you
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Just change this line to results <- syncResult{errors: []*ReleaseError{err}}
Deploy Kubernetes Helm Charts. Contribute to roboll/helmfile development by creating an account on GitHub.
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
thanks man
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
ah wait we need a bit more work
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
ok
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Try changing these lines to:
relErrs := []*ReleaseError{}
if relErr == nil {
relErrs = append(relErrs, relErr)
}
if _, err := st.triggerPostsyncEvent(release, "sync"); err != nil {
st.logger.Warnf("warn: %v\n", err)
relErrs = append(relErrs, &ReleaseError{err})
}
if len(relErrs) > 0 {
results <- syncResult{errors: relErrs}
} else {
results <- syncResult{}
}
Deploy Kubernetes Helm Charts. Contribute to roboll/helmfile development by creating an account on GitHub.
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
thanks i’ll give it a try
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
make install
is handy if you want to install the helmfile binary built from your binary to go/bin (usually ~/go/bin)
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
i’m on the hello world
level of go so that’s helpful
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
helmfile -v
to see the version number to verify you’re running the correct binary
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
then ensuring existence of go 1.12.x+ on your machine will also help. for me its like:
$ go version
go version go1.12.5 darwin/amd6
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
yeah i had go 1.11.x so i’m updating
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
great
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
if you’re using make install
, ensure your $PATH contains the go/bin in it
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
s/updating/upgrading
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
pkg/state/state.go:425:46: cannot use err (type error) as type *ReleaseSpec in field value
pkg/state/state.go:425:46: too few values in &ReleaseError literal
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
try changing relErrs = append(relErrs, &ReleaseError{err})
to relErrs = append(relErrs, newReleaseError(release, err))
// updated
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
newReleaseError is not a type
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
argh! it should be newReleaseError(release, err)
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb926e7]
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
would you mind giving me the rest of the message, especially the first several lines of stack trace?
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
full stack trace is too long to post but i’ll paste it in chunks
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
goroutine 1 [running]:
github.com/urfave/cli.HandleAction.func1(0xc00023ce28)
/home/zmiccar/go/pkg/mod/github.com/urfave/[email protected]/app.go:474 +0x287
panic(0xca5980, 0x1570ff0)
/usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/roboll/helmfile/pkg/app.context.wrapErrs(0xc00038c120, 0xc00000b0e0, 0xc000388a00, 0x3, 0x4, 0x15a2d70, 0x0)
/home/zmiccar/src/helmfile/pkg/app/app.go:627 +0x1c7
github.com/roboll/helmfile/pkg/app.context.clean(0xc00038c120, 0xc00000b0e0, 0xc000388a00, 0x3, 0x4, 0x3, 0x4)
/home/zmiccar/src/helmfile/pkg/app/app.go:614 +0x13e
github.com/roboll/helmfile/pkg/app.(*App).visitStates.func1(0xc0000d5da9, 0xa, 0xc000038700, 0x35, 0x0, 0x0)
/home/zmiccar/src/helmfile/pkg/app/app.go:334 +0x878
github.com/roboll/helmfile/pkg/app.(*App).visitStateFiles.func1(0xc00003c2a0, 0x2c)
/home/zmiccar/src/helmfile/pkg/app/app.go:220 +0x9d
github.com/roboll/helmfile/pkg/app.(*App).within(0xc00038c120, 0xc0000d5da0, 0x8, 0xc00004c080, 0xc000258148, 0x2)
/home/zmiccar/src/helmfile/pkg/app/app.go:181 +0x3f6
github.com/roboll/helmfile/pkg/app.(*App).visitStateFiles(0xc00038c120, 0xc0000d5da0, 0x13, 0xc000090180, 0x0, 0xdbb2f4)
/home/zmiccar/src/helmfile/pkg/app/app.go:214 +0x29f
github.com/roboll/helmfile/pkg/app.(*App).visitStates(0xc00038c120, 0xc0000d5da0, 0x13, 0x15a2d70, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0000386c0, ...)
/home/zmiccar/src/helmfile/pkg/app/app.go:255 +0xd4
github.com/roboll/helmfile/pkg/app.(*App).visitStates.func1(0xdad353, 0xd, 0xc0000be3f0, 0x23, 0x0, 0x0)
/home/zmiccar/src/helmfile/pkg/app/app.go:314 +0x5ad
github.com/roboll/helmfile/pkg/app.(*App).visitStateFiles.func1(0x0, 0xc0002585b0)
/home/zmiccar/src/helmfile/pkg/app/app.go:220 +0x9d
github.com/roboll/helmfile/pkg/app.(*App).within(0xc00038c120, 0xda48d4, 0x1, 0xc000388780, 0xc0002587a8, 0x2)
/home/zmiccar/src/helmfile/pkg/app/app.go:162 +0x725
github.com/roboll/helmfile/pkg/app.(*App).visitStateFiles(0xc00038c120, 0x0, 0x0, 0xc0000d15c0, 0x20, 0xcf6da0)
/home/zmiccar/src/helmfile/pkg/app/app.go:214 +0x29f
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
github.com/roboll/helmfile/pkg/app.(*App).visitStates(0xc00038c120, 0x0, 0x0, 0x15a2d70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/zmiccar/src/helmfile/pkg/app/app.go:255 +0xd4
github.com/roboll/helmfile/pkg/app.(*App).VisitDesiredStatesWithReleasesFiltered(0xc00038c120, 0x0, 0x0, 0xc0001c5f60, 0xc000258901, 0xc00038a600)
/home/zmiccar/src/helmfile/pkg/app/app.go:403 +0x426
github.com/roboll/helmfile/pkg/app.(*App).ForEachState(0xc00038c120, 0xc00038a600, 0xc0001c5f50, 0xd89580)
/home/zmiccar/src/helmfile/pkg/app/app.go:349 +0x81
github.com/roboll/helmfile/pkg/app.(*App).Sync(0xc00038c120, 0xf50940, 0xc0001c5f50, 0xc0001c5f50, 0xcd1560)
/home/zmiccar/src/helmfile/pkg/app/app.go:125 +0x6e
main.main.func7(0xc00038c120, 0xc0002fd400, 0x0, 0xc0001c5f30, 0x0)
/home/zmiccar/src/helmfile/main.go:272 +0x6d
main.action.func1(0xc0002fd400, 0x0, 0x0)
/home/zmiccar/src/helmfile/main.go:548 +0x121
reflect.Value.call(0xc58980, 0xc0001c5b00, 0x13, 0xda52b3, 0x4, 0xc000258dc8, 0x1, 0x1, 0xc0000d6000, 0x411d03, ...)
/usr/local/go/src/reflect/value.go:447 +0x461
reflect.Value.Call(0xc58980, 0xc0001c5b00, 0x13, 0xc000258dc8, 0x1, 0x1, 0xc0002efa00, 0xc0002efa48, 0x140)
/usr/local/go/src/reflect/value.go:308 +0xa4
github.com/urfave/cli.HandleAction(0xc58980, 0xc0001c5b00, 0xc0002fd400, 0x0, 0x0)
/home/zmiccar/go/pkg/mod/github.com/urfave/[email protected]/app.go:483 +0x1ff
github.com/urfave/cli.Command.Run(0xda5963, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdd089d, 0x43, 0x0, ...)
/home/zmiccar/go/pkg/mod/github.com/urfave/[email protected]/command.go:186 +0x8d1
github.com/urfave/cli.(*App).Run(0xc00009ca80, 0xc0000bc020, 0x2, 0x2, 0x0, 0x0)
/home/zmiccar/go/pkg/mod/github.com/urfave/[email protected]/app.go:237 +0x601
main.main()
/home/zmiccar/src/helmfile/main.go:397 +0x2835
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
ahh if relErr == nil {
must be if relErr != nil {
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
to wrap up, you should change these lines to:
relErrs := []*ReleaseError{}
if relErr != nil {
relErrs = append(relErrs, relErr)
}
if _, err := st.triggerPostsyncEvent(release, "sync"); err != nil {
st.logger.Warnf("warn: %v\n", err)
relErrs = append(relErrs, newReleaseError(release, err))
}
if len(relErrs) > 0 {
results <- syncResult{errors: relErrs}
} else {
results <- syncResult{}
}
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
patch in case someone is interested in the tmp fix:
diff --git a/pkg/state/state.go b/pkg/state/state.go
index 99818cd..b0b0849 100644
--- a/pkg/state/state.go
+++ b/pkg/state/state.go
@@ -415,14 +415,20 @@ func (st *HelmState) SyncReleases(affectedReleases *AffectedReleases, helm helme
}
}
- if relErr == nil {
- results <- syncResult{}
- } else {
- results <- syncResult{errors: []*ReleaseError{relErr}}
+ relErrs := []*ReleaseError{}
+ if relErr != nil {
+ relErrs = append(relErrs, relErr)
}
if _, err := st.triggerPostsyncEvent(release, "sync"); err != nil {
st.logger.Warnf("warn: %v\n", err)
+ relErrs = append(relErrs, newReleaseError(release, err))
+ }
+
+ if len(relErrs) > 0 {
+ results <- syncResult{errors: relErrs}
+ } else {
+ results <- syncResult{}
}
if _, err := st.triggerCleanupEvent(release, "sync"); err != nil {
2019-07-22
![eviln1 avatar](https://secure.gravatar.com/avatar/1c99ac5f53a8686f25ebdca51905a4b4.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
hey, just joined the slack, but been using helmfile for a 6+ months; thanks alot for making it
![eviln1 avatar](https://secure.gravatar.com/avatar/1c99ac5f53a8686f25ebdca51905a4b4.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
i’ve got a quick question: are environments: []
propagated to children helmfiles: []
? looks that they aren’t from my experiments, and not sure if its by design
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
hey! you can selectively inherit values
https://github.com/roboll/helmfile/issues/725#issuecomment-506101418
We are trying to use helmfile in our pipeline. For this we hoped to use a parent helmfile (with repository configuration and helm-defaults) and subhelmfiles that INHERIT from this master helmfile. …
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
if you want an easier way to inherit all the values, it isn’t implemented yet, but here’s the feature request https://github.com/roboll/helmfile/issues/762
Helmfile doesn't inherit values to sub-helmfiles by default today. It does support selectively inheriting some values(#725), but there's no easy way to inherit all the values. Perhaps it wo…
![eviln1 avatar](https://secure.gravatar.com/avatar/1c99ac5f53a8686f25ebdca51905a4b4.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
also trying stuff out with bases: []
, but i’m probably getting something wrong
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
bases
implicitly inherit all the values from the parent and sub-helmfiles. but there’s a plan to make it explicit
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 peo…
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
Hi, Hoping someone knows off the top of their head why this wouldn’t work
templates:
dataproduct: &dataproduct
namespace: dataproduct
chart: chartmuseum/cdp-chart
version: 1.0.1
values:
- app
name: {{`"{{.Release.Name}}"`}}
- {{ .Environment.Name }}.yaml
releases:
- name: my-dp
<<: *dataproduct
- name: another-dp
<<: *dataproduct
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
mind sharing the error message you’re seeing?
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
nm im reading
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
Specifically
- app:
name:
{{`"{{.Release.Name}}"`}}
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
It seems to be an issue with nesting values because if I change it to
values:
- appName: {{`"{{.Release.Name}}"`}}
it doesn’t fail
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
The error is
YAML parse error on cdp-chart/templates/rbac.yaml: error converting YAML to JSON: yaml: invalid map key: map[interface {}]interface {}{".Release.Name":interface {}(nil)}
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
@Ben could you copy-paste your actual template once again? I see a trailing :
is missing after app
in https://sweetops.slack.com/archives/CE5NGCB9Q/p1563858986015700
Hi, Hoping someone knows off the top of their head why this wouldn’t work
templates:
dataproduct: &dataproduct
namespace: dataproduct
chart: chartmuseum/cdp-chart
version: 1.0.1
values:
- app
name: {{`"{{.Release.Name}}"`}}
- {{ .Environment.Name }}.yaml
releases:
- name: my-dp
<<: *dataproduct
- name: another-dp
<<: *dataproduct
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
anyways this seems to work without emitting such error on my machine:
templates:
dataproduct: &dataproduct
namespace: dataproduct
chart: chartmuseum/cdp-chart
version: 1.0.1
values:
- app:
name: {{`"{{.Release.Name}}"`}}
- {{ .Environment.Name }}.yaml
releases:
- name: myapp
chart: stable/mysql
namespace: myapp
<<: *dataproduct
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
@mumoshu Sorry, yes the original has the colon
environments:
default:
values:
- default.yaml
production:
values:
- production.yaml
templates:
dataproduct: &dataproduct
namespace: dataproduct
chart: chartmuseum/cdp-chart
version: 1.0.0
values:
- app:
name: {{`"{{.Release.Name}}"`}}
- {{ .Environment.Name }}.yaml
releases:
- name: california-sos
<<: *dataproduct
- name: rdc
<<: *dataproduct
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
helm version
Client: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"clean"}
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
@Ben Which helmfile version are you using?
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
> helmfile -v
helmfile version v0.80.1
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
thx
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
I’m doubting something is wrong with your cdp-chart/templates/rbac.yaml
. Could you share it?
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: {{ .Values.app.name }}
namespace: {{ .Values.app.namespace }}
rules:
- apiGroups:
- ""
resources:
- configmaps
resourceNames:
- "{{ .Values.app.name }}-config"
verbs:
- get
- apiGroups:
- ""
resources:
- secrets
resourceNames:
- "{{ .Values.app.name }}-secret"
- "gitlab-registry"
- "{{ .Values.app.name }}-tls"
verbs:
- get
{{- end -}}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: {{ .Values.app.name }}
namespace: {{ .Values.app.namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ .Values.app.name }}
subjects:
- kind: ServiceAccount
name: {{ .Values.app.name }}
namespace: {{ .Values.app.namespace }}
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Also - enabling debug logs like helmfile --log-level=debug
allows you to see the yaml after rendering the template, which would help debugging
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
Actually the error states the error occurs in serviceaccount.yaml which looks like
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.app.name }}
namespace: {{ .Values.app.namespace }}
labels:
app: {{ .Values.app.name }}
{{- end -}}
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
ah sry I missed https://sweetops.slack.com/archives/CE5NGCB9Q/p1563859105017700
It seems to be an issue with nesting values because if I change it to
values:
- appName: {{`"{{.Release.Name}}"`}}
it doesn’t fail
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
indeed this can be a bug in helmfile!
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
ahh it isn’t rendering nested strings.. i’ll open an issue for that
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
@Ben Is this a blocker to you? (I’ll prioritize this accordingly if so
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
Thanks @mumoshu It’s not a blocker but would definitely remove a lot of boilerplate config for us
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Thanks! I’ll try to fix it asap. Here’s the issue https://github.com/roboll/helmfile/issues/769
This is reported in our official Slack channel: https://sweetops.slack.com/archives/CE5NGCB9Q/p1563863513024900 This doesn't work, leaving "{{.Release.Name}}" not rendered: releases: …
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
Much appreciated @mumoshu
2019-07-23
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
Do you have any knowledge of how people are doing continuous deployment (or nearly CD with some manual gates before running sync) using helmfile? On the surface it seems simple; build, test, publish docker image, update helmfile with new image tag (or chart version if publishing a new chart) and run sync. However, it gets much more complicated once you have to deploy to multiple environments/tenants and also stage helmfile changes. Just wondering if you’ve seen any good approaches?
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
We run Helmfile under atlantis
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
We centralize our Helmfiles in a repo
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Then use remote Helmfiles to pull them in pinned to a release (kind of like terraform)
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
Thanks @Erik Osterman (Cloud Posse) The thing I’m struggling with is how to update centralised helmfiles in an automated way. At the moment I can only see one option; Each microservice git project’s build pipeline creates/publishes docker image, clones the helmfile repo, creates a branch, using a script (sed, etc) updates the chart version or values, commits changes. Then another pipeline checks for helmfile repo changes and deploys to an environment based on branch name (feature/nnn, release/nnn, master). Once the helmfile sync is finished, a tester tests the system in a test env and if happy merges the helmfile repo branch into master. The same pipeline detects the change in git and deploys to prod because changes are now on master. Does that seem reasonable? How does your process differ from this?
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
in our model, we run one repo per AWS account.
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
we build one container per account based on geodesic
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Geodesic is a cloud automation shell. It's the fastest way to get up and running with a rock solid, production grade cloud platform built on top of strictly Open Source tools. ★ this repo! h…
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
we have a /conf/helmfiles/helmfile.yaml
folder that looks like this
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
# Ordered list of releases.
helmfiles:
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/reloader.yaml?ref=0.48.0>"
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/cert-manager.yaml?ref=0.48.0>"
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/prometheus-operator.yaml?ref=0.48.0>"
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/kiam.yaml?ref=0.48.0>"
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/external-dns.yaml?ref=0.48.0>"
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/aws-alb-ingress-controller.yaml?ref=0.48.0>"
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/kube-lego.yaml?ref=0.48.0>"
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/nginx-ingress.yaml?ref=0.48.0>"
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/heapster.yaml?ref=0.48.0>"
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/dashboard.yaml?ref=0.48.0>"
- path: "git::<https://github.com/cloudposse/helmfiles.git@releases/codefresh-account.yaml?ref=0.48.0>"
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
this allows us to surgically version pin individual accounts
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
our docker images inherit from geodesic like this: https://github.com/cloudposse/testing.cloudposse.co/blob/master/Dockerfile
Example Terraform Reference Architecture that implements a Geodesic Module for an Automated Testing Organization in AWS - cloudposse/testing.cloudposse.co
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
[testing.cloudposse.co](http://testing.cloudposse.co)
represents one AWS account.
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
we do the same sort of thing for [prod.cloudposse.co](http://prod.cloudposse.co)
, [staging.cloudposse.co](http://staging.cloudposse.co)
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
in our case, we do this for our customers so our *.[cloudposse.co](http://cloudposse.co)
repos are out of date
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
Thanks @Erik Osterman (Cloud Posse), Makes sense. Like the idea of specifying sub-helmfile versions. Do you manually update the helmfiles whenever a chart or docker image changes?
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Yes, everything is deliberate
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Pinning to subhelmfiles has been awesome. We don’t need to worry about breaking changes or forcing updates across environments.
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
@Ben We’ve got a single helmfile with all the releases for all the environments defined. It’s placed in a separate repo, not within the main codebase. Since we’ve got a set of stages (dev, several stagings, prod) and per client installations we are leveraging environments:
feature extensively to make it DRY. The workflow is pretty manual indeed, one has to set a new version of the docker image and/or helm chart for the certain environment. To control things pull-request/merge-request workflow could be considered. Not the best approach for sure, but kinda work for us right now.
![Ben avatar](https://secure.gravatar.com/avatar/fb8b85ff195bca8b9ae0a5b7cab7ed4a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
Thanks @Andrew Nazarov Sounds similar to what I was envisioning. I think we’ll go down this path and if the manual updates become cumbersome we’ll try and automate them.
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
@Erik Osterman (Cloud Posse) Out of curiosity, what is this Atlantis thing?
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Atlantis: Terraform Pull Request Automation
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
it lets us run plan (diff) and apply using github comments.
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
Thanks. It looks quite interesting. I’m I right that you use TF to execute helmfile?
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
No, Atlantis can run freestyle steps
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
Cool, thank you.
2019-07-24
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
Would be nice to have condition: boolean
on hooks because sometimes you might want to run a hook only if installed: boolean
is true on another release.. if course it can be wrapped by other logic but would be cleaner to have a flag for it
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
bugs me that helm test --cleanup
does not output the logs before removal on error
![Emanuel avatar](https://avatars.slack-edge.com/2019-07-24/704523693669_4632b0875a206ab3babb_72.png)
Hiya. Currently I’m doing this:
releases:
- name: abc-namespace
chart: stable/magic-namespace
set:
- name: tiller.image.tag
value: v{{ .Values.tillerVersion }}
- name: xyz-namespace
chart: stable/magic-namespace
set:
- name: tiller.image.tag
value: v{{ .Values.tillerVersion }}
Is there a way to set tiller.image.tag as a default for all releases so that I don’t have to specify that set every time? I’ve seen you can use release templates, but I wonder if there’s an even more general way.
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
@Emanuel Hey! Unfortunately there’s only a marginally better way:
templates:
setTillerImage: &setTillerImage
- name: tiller.image.tag
value: v{{ .Values.tillerVersion }}
releases:
- name: abc-namespace
chart: stable/magic-namespace
set:
- <<: *setTillerImage
- name: xyz-namespace
chart: stable/magic-namespace
set:
- <<: *setTillerImage
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
would you mind opening a feature request if you need something better? thx!
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
can someone tell me if i’m not understanding environments:
correctly and how it applies to releases. i have 2 files in helmfile.d
:
istio.yaml
environments:
staging:
releases:
...
app.yaml
environments:
default:
staging:
releases:
...
- if i run
helmfile sync
i expect onlyapp.yaml
releases to be synced - if i run
helmfile -e staging sync
i expect both to be synced.
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
@Mical Your assumption is legit but I’m skeptical if I implemented helmfile as such
- if i run helmfile sync
i expect only app.yaml
releases to be synced
- if i run
helmfile -e staging sync
i expect both to be synced.
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
The general rule of Helmfile is that it has an empty default
environment by default. And any reference to undefined environment results in a failure.
That said, helmfile --env default diff
or helmfile diff
should process both yamls because they all refer to the default
env. helmfile --env staging diff
should also process both yamls as it refers to the staging
env defined in the both yamls
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
What I dont understand yet is this:
https://sweetops.slack.com/archives/CE5NGCB9Q/p1563977112071400
because if i replace default
with dev
in my case and run helmfile -e dev sync
then it only applies to app.yaml
releases (edited)
If you have dev
defined in both app.yaml and istio.yaml, they should work on the dev
environment.
What happened to istio.yaml
in your case? You encountered no error and got default
loaded into istio.yaml
?
because if i replace default
with dev
in my case and run helmfile -e dev sync
then it only applies to app.yaml
releases
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
My initial problem was that I did not want all releases to be part of the default
environment. I only managed to do this with a conditional wrapped around everything which I didn’t really like. Now I’m only using explicit environments, trying to avoid default
.
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
In the message you linked to I was talking about replacing default
with an explicit dev
environment.
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Ah! So you wanted Helmfile to ignore all the releases defined in istio.yaml
when in default
environment
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
Yes, but I realized that’s not how it works
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Yep. Then replacing default
with anything else should work
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Good
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Btw I see emerging use of {{ if eq .Environment.Name "theenv" }}
in helmfile.yaml templates these days
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
We use the pre-release version for dev/stg and release versions for other environments. Currently, helmfile deps only supports a single lockfile per helmfile. Something like this will not work with…
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
cc/ @Shane
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
So I’m considering to add first-class support for toggling releases per env(or even helmfile/state values)
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
That would be nice
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
releases:
- name: istio
chart: istio.io/istio
if:
environment:
- dev
- staging
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
@Mical If you had an idea or suggestion on the syntax, I’d appreciate it if you could share it
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
Sounds cool. What about just environment:
like
releases:
- name: istio
chart: istio.io/istio
environment:
- dev
- staging
?
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
Yeah, I would vote for a list of environments like @Andrew Nazarov proposed.
![Shane avatar](https://avatars.slack-edge.com/2018-11-16/481069875217_6fbbee537c0736f89e7f_72.png)
Our layout is essentially a global helmfile as our ops people are lazy(me). And a helmfile per team per environment. 90% of our global helmfile things are installed in all environments with the exception of jenkins being installed in only prod and a test service being installed in only dev. Of the two options above I like the second one better, but I still imagine a better method for all of this logic has to exist.
![Shane avatar](https://avatars.slack-edge.com/2018-11-16/481069875217_6fbbee537c0736f89e7f_72.png)
Possibly having a global helmfile, but where it includes sub helmfiles?
![Shane avatar](https://avatars.slack-edge.com/2018-11-16/481069875217_6fbbee537c0736f89e7f_72.png)
environments:
prod:
values:
- prod/_environment/values.yaml
secrets:
- prod/_environment/secrets.yaml
helmfiles:
- helmfiles/jenkins.yaml
![Shane avatar](https://avatars.slack-edge.com/2018-11-16/481069875217_6fbbee537c0736f89e7f_72.png)
That way you define the helmfile snipets and include them as we already have a list of environments in the helmfile itself I would rather see the environments be the first class citizens.
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
Join us here: https://github.com/roboll/helmfile/issues/781
I'm seeing emerging use of {{ if eq .Environment.Name "theenv" }} in helmfile.yaml templates for making releases optional for a subset of environments. To me, helmfile templates are n…
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
don’t want to wrap istio releases with {{ if eq .Environment.Name "staging" }}
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
or is it that default
applies to all implicitly?
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
Basically you want to set values under envs and use it like:
environments:
dev:
values:
- foo: aaa
prod:
values:
- foo: bbb
releases:
something: {{ .Environment.Values.foo }}
for helmfile -e dev apply
something
would be aaa
for helmfile -e prod apply
something
would be bbb
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
yeah that i know, was wondering about the default
environment if that is applied to all releases
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
because if i replace default
with dev
in my case and run helmfile -e dev sync
then it only applies to app.yaml
releases
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
i expect i was abusing the default
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
but thanks for input @Andrew Nazarov (chose some bad names in my example btw.. updated)
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
Actually, I thought environments don’t affect releases until you define something like mentioned {{ if eq .Environment.Name "app" }}
. What you are talking about is something new to me. I mean, that helmfile -e dev
syncs only releases in the app.yaml. It it documented somewhere?
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
Not sure if it is, but it works that way at least
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
I hope @mumoshu will comment.
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
but i need {{ if ne .Environment.Name "default" }}
around my istio releases to exclude them from the default
env
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
Ah, then it’s expected)). At first I thought you somehow managed to do it without if .Environment.Name
since you wrote “don’t want to wrap istio releases ”
![Andrew Nazarov avatar](https://avatars.slack-edge.com/2021-06-09/2146832855878_fbb84e3b2832cc494a93_72.jpg)
Thanks for the clarification.
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
I meant that i don’t want to wrap it with {{ if eq .Environment.Name "xxx" }}
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
not {{ if ne .... }}
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
would prefer not having to add the not equals conditional though
2019-07-25
![Yannis avatar](https://secure.gravatar.com/avatar/5bf87f39804323d4e9d1179373c62a43.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0004-72.png)
Hey, just started to experiment with Helmfile and besides some hiccups with helm-diff, I was wondering, is it possible to capture directly stdout from a command and use it in a template? E.g. something like {{ requiredEnv "PLATFORM_ENV" }}
, maybe {{ getOutput "echo Hello" }}
?
2019-07-29
2019-07-30
![Emanuel avatar](https://avatars.slack-edge.com/2019-07-24/704523693669_4632b0875a206ab3babb_72.png)
@Yannis is that not what {{ exec }} does? (I’m also new to Helmfile)
![Emanuel avatar](https://avatars.slack-edge.com/2019-07-24/704523693669_4632b0875a206ab3babb_72.png)
![Yannis avatar](https://secure.gravatar.com/avatar/5bf87f39804323d4e9d1179373c62a43.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0004-72.png)
2019-07-31
![Emanuel avatar](https://avatars.slack-edge.com/2019-07-24/704523693669_4632b0875a206ab3babb_72.png)
I think I don’t fully understand how environments work. If I have
helmfiles:
- ./*/helmfile.yaml
And I want to use helmfile -e production apply
then does each of those subhelmfiles have to define the environment? Else you’d get err: no releases found that matches specified selector() and environment(production), in any helmfile
So what would that look like? Do I put this code at the top of each subhelmfile? There has to be a better way!
bases:
{{- range $_, $file := ( exec "sh" (list "-c" "echo ../environments/*yaml") | splitList " " ) }}
- {{ trim $file }}
{{ end }}
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
does each of those subhelmfiles have to define the environment
Yep
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
There has to be a better way!
Definitely
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
If environments are global, I’d expect to define them in the parent helmfile only.
The point is that they aren’t global. To make each sub-helmfile modular, they are intentionally not global.
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Btw, did I implement globbing in bases:
? That would reduce the boilerplate to:
bases:
- ../environments/*yaml
If it doesn’t work, it would worth a feature request
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
My belief is that sub-helmfile
shouldn’t rely on environments so that they are modular and reusable.
Once you’ve removed all the environments from sub-helmfiles, https://github.com/roboll/helmfile/issues/762 will allow you to pass necessary helmfile values as template params of sub-helmfiles
Helmfile doesn't inherit values to sub-helmfiles by default today. It does support selectively inheriting some values(#725), but there's no easy way to inherit all the values. Perhaps it wo…
![Emanuel avatar](https://avatars.slack-edge.com/2019-07-24/704523693669_4632b0875a206ab3babb_72.png)
If environments are global, I’d expect to define them in the parent helmfile only.
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
A --no-hooks
option to helmfile
would be nice.
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
I’m hearing - I’d appreciate it if you could write up a feature request with your use-case
GitHub is where people build software. More than 36 million people use GitHub to discover, fork, and contribute to over 100 million projects.
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Alternatively, would it make sense to extend our helmfile.yaml syntax to make hooks conditional depending on environment names or helmfile values?
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
That’s possible today with helmfile templates, but we’re having a discussion to make it possible without templates. For toggling releases without templates, we have https://github.com/roboll/helmfile/issues/781
I'm seeing emerging use of {{ if eq .Environment.Name "theenv" }} in helmfile.yaml templates for making releases optional for a subset of environments. To me, helmfile templates are n…
![Mical avatar](https://secure.gravatar.com/avatar/6c1e9c59d90edd6d6a30988542bac4b0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png)
That would be nice, but would like the option to disable hooks globally which I think a --no-hooks
flag would make most sense. I can file an issue for it.
![mumoshu avatar](https://secure.gravatar.com/avatar/8e045bf747ca7a90b1d955dc30217271.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Thanks! Looking forward to read it