Skip to content
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

Any way to get helmfile status to filter out irrelevant tiller args? #210

Closed
irlevesque opened this issue Aug 16, 2018 · 12 comments
Closed

Comments

@irlevesque
Copy link

I'm specifying tiller args as documented in the readme, via:

helmDefaults:
  tillerNamespace: {{ env "DEPLOY_ENV" }}
  args:
    - "--wait"
    - "--recreate-pods"
    - "--timeout=600"
    - "--force"
    - "--reset-values"

When I run a helmfile status, however, it fails with:

→ DEPLOY_ENV=staging helmfile --log-level debug -l chart=app status
Getting status app-staging
exec: helm status app-staging --force --reset-values --tiller-namespace=staging --wait --recreate-pods --timeout=600
Error: unknown flag: --force

err: exit status 1

Is there a recommended way to include the sync flags separately from delete / status flags?

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 20, 2018

Thanks for trying helmfile. Good catch!
AFAIK there's no workaround for it right now.

The easiest fix for it would be to omit all the custom args for the helm commands on helmfile status.

@rmartinez3 On the way towards the fix, I guess we get to modify your implementation of getArgs to return two args - one for helm global args like --tiller-namespace that are passed to helm.SetExtraArgs, one for other args like --force --recreate-pods that is passed only to SyncReleases. Would you be ok with that? Please tell me If you had reasons to not do so. Thanks!

@sstarcher
Copy link
Contributor

@mumoshu that solution does not get around args that are not supported by say helm-diff plugin through right? To do that we would likely have to make the args first class. Or at least keep a list of relevant args.

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 23, 2018

@sstarcher Certainly! I found something similar while implementing wait: true in helmfile.yaml https://github.com/roboll/helmfile/pull/222/files#r212160642

Maintaining lists of relevant args would require comparable amount of code to make them first class args under releases[], like I did for wait. And I believe first class args are generally easier to read and write.

Now the plan is:

  • Recommend to use helmDefaults.args only for global helm args
  • Make force, recreate-pods and timeout first class args under releases[]

After that, @irlevesque's example would turn into something like this:

helmDefaults:
  tillerNamespace: {{ env "DEPLOY_ENV" }}

releases:
- name: myapp
   chart: ...
   wait: true
   recreatePods: true
   timeout: 600
   force: true

Note that --reset-values can be safely omitted from your helmfile.yaml, because helmfile always provide the flag to helm.

@rmartinez3
Copy link
Contributor

@mumoshu fine by me to change implementation. Makes sense for helm defaults to only take account of global args. And separate other flags like you explained.

@sstarcher
Copy link
Contributor

supporting timeouts and other values directly at the release makes perfect sense, but also supporting them as global for a single helmfile can also be very useful.

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 23, 2018

supporting them as global for a single helmfile can also be very useful.

Sounds nice. Just to make sure I got it right, do you want it even though we can use yaml anchor?

defaults: &defaults
  wait: true
  
releases:
- <<: *defaults
  name: myapp
  chart: ...

@sstarcher
Copy link
Contributor

an anchor would be less labor intensive, but having it as a global would be more useful. My specific usecase is I have a multiple helmfiles in a helmfile.d directory. Each contains different groups, but say I have this one helmfile in the directory that contains 50 copies of service X. Service X needs a --wait and a timeout. With the anchor example I would have to duplicate that on 50 extra lines, but with a global top level default I could just say all service X's in this file have --wait and --timeout of Y.

Having 50 services of X is a real usecase I have. Certainly doable with the anchor example.

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 23, 2018

@sstarcher Makes sense! Thanks.

Btw, you've included --set image.tag in args in #212. You did that in order to avoid repeating the same sets for all releases, right?

@sstarcher
Copy link
Contributor

@mumoshu that as just a random example. My specific use-case was for controlling hooks.

--set app1.bootstrap=true,app2.bootstrap=false

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 24, 2018

Opened #229 and #230 respectively. I'm closing this after resolving the two issues.

@sstarcher Would you like to have a better support for your use-case of the default --sets?

Perhaps it would be to enhance helmDefaults to accept some inline values that are propagated to all the releases?

Anyway, I'd appreciate if you could submit an another feature request for it 👍

@mumoshu
Copy link
Collaborator

mumoshu commented Sep 5, 2018

@irlevesque Hey! Could you rewrite your helmfile.yaml to:

helmDefaults:
  tillerNamespace: {{ env "DEPLOY_ENV" }}
  wait: true
  recreatePods: true
  timeout: 600
  force: true

And now, you can even replacec DEPLOY_ENV by using #267:

helmDefaults:
  tillerNamespace: {{ .Environment.Name }}
  wait: true
  recreatePods: true
  timeout: 600
  force: true

@mumoshu
Copy link
Collaborator

mumoshu commented Sep 5, 2018

Closing as resolved, but please feel free to reopen if it doesn't work for you.

@mumoshu mumoshu closed this as completed Sep 5, 2018
willgraf added a commit to vanvalenlab/kiosk-console that referenced this issue Feb 4, 2020
* upgrade build-harness to 0.31.1 and geodesic to 0.123.1.

* Fix `gcloud-login.sh` to only call `gcloud auth login` once.

* update `helmDefaults` with the suggested workaround from github.com/roboll/helmfile/issues/210.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants