-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible to set selector in parent helmfile? #344
Comments
@2ZZ Yeah I see that there are use-cases like this! What if we enhance helmfiles:
- source: apps-helmfile.yaml
selectors:
- enabled=app1 |
that would be ideal for my use case 👍 |
The implementation for this would rely on the same mechanism for #168. The difference is that we add an another path to specify default selectors that is used while running sub-helmfiles. |
Hi @mumoshu , I just discovered the context setting in the parent helmfile is not inherited in the included helmfiles, is that a bug or intentional? |
@2ZZ That's intentional! I basically want each helmfile.yaml to be self-contained. That is, there should be no global state among parent and sub helmfiles. |
I would really appreciate this feature too cause we are compositing helmfiles but we sometimes do not want to install everything in the sub-helmfile. |
@sgandon Can we start by reverting my previous comment above, and just pass the context(label selector from the command-line) down to all the sub-helmfiles? The rationale is that I want everyone to be able to split helmfile.yaml without tears when it gets huge enough. The label selector applied to the parent helmfile only defeats this use-case. Because then, once you start splitting your helmfiles, you are unable to rely on label selector to selectively deploy releases anymore. |
@2ZZ Would you mind if I revert my comment and just make it pass label selector down to sub-helmfiles? |
@mumoshu I am sorry I do not get what you are suggesting. But I think my use case is pretty similar to |
in my opinion the commandline should only impact the current helmfile for simplicity. That does not mean we can find a way to allow passing argument to sub-helmfile, but this should be done explicitly and not automatically. |
Does that mean what you want is basically "filter releases according to env
values"?
2019年4月8日(月) 0:44 sgandon <[email protected]>:
… in my opinion the commandline should only impact the current helmfile for
simplicity. That does not mean we can find a way to allow passing argument
to sub-helmfile, but this should be done explicitly and not automatically.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#344 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABV-bheJ70lfglpQAqc_QBzWDvqbgFQks5vehJIgaJpZM4WqR0E>
.
|
I am not sure what you mean with
|
I believe this would match the desire of keeping the helmfile independent from each other in the sense that there is nothing more you can do using en composite helmfile that using multiple command lines. |
In the end I think you should not leak selectors to subhelmfile cause this would mean you know all the labels of all the sub-helmfiles that are composed together. |
the label of this issue is |
One possible way around this issue is to split the inital helmfile with multiple releases and labels to multiple helmfiles each for different set of releases. And this what we do right now, but then labels and selectors are no more helpfull and that is a shame cause you can cope with higher order of complexity using labels selector that you would with multiple helmfiles. |
I am wondering if we could not provide both alternatives, that is have an inheritance of the selectors (either implicitly 'yucks', or explicitly) and also provide a way to specify them manually in the yaml.
This way you can have 3 different workflow, no selectors, inherited or manually set. |
Ah, seems like I have been forgotten about that helmfile does passes selector down to sub-helmfiles! Thanks for reminding me about that. For the meantime, I would like to just add |
...and that is to keep backward-compatibility. We can definitely revisit before helmfile reaching v1.0. So, in short term, your example would turn into something like:
|
Another idea is, in addition to |
I like all those ideas, I am currently developing it and hope to provide a PR soon. |
@mumoshu in your latest example one case is missing or I did not get requirements right.
but may there is another more yaml/elegant way to specify this ? |
Fixes #344 by allowing explicit selectors to be specified for composed helmfiles using the following structure ```yaml helmfiles: - path: helmfile.d/a*.yaml selectors: - name=prometheus - name!=zipkin - helmfile.d/b*.yaml - path: helmfile.d/c*.yaml selectors: {} ``` 2 modes here : * legacy mode when no the env var HELMFILE_EXPERIMENTAL is not set to true * no selector : inherit from the command line. * selector: is specified then it is used (an emty means no inheritance from command line and take everything). * experimental when the env var HELMFILE_EXPERIMENTAL=true * no selector : nothing is inherited from the command line so use all releases. * selector: is specified then it is used (an emty means no inheritance from command line and take everything).
I have a helmfile that pulls in another helmfile
cluster1-helmfile.yaml
Inside the second helmfile there are selectors
apps-helmfile.yaml
Currently I deploy it using
Instead is it possible to set the enabled label in the parent helmfile? Similar to #168 (comment)
The text was updated successfully, but these errors were encountered: