helmfile
helmfile copied to clipboard
pass-thru options for helmfile template
Thanks for the great tool! Trying to best leverage helmfile in a gitops situation (specifically looking at argo-cd ATM) and found a few options that would be helpful to pass through to helm:
--no-hooks--skip-crds--api-versions
I'm not sure exactly how --api-versions versions is meant to be used, meaning, not sure if it can be specified multiple times, or once with comma-separate values or what.
Thanks!
https://github.com/roboll/helmfile/issues/1014#issuecomment-570055290
It appears --is-upgrade has been re-introduced as well. Could be useful: https://github.com/helm/helm/pull/7054
I noticed there's a --args command that seems to let you pass thru anything you'd like. This could be unnecessary.
@mumoshu I could use an option for skip-crds, preferably in the helmfile as with createNamespace.
helmfile sync --args --skip-crds
is a problem, because I need it for helm install and helm upgrade, but if installed: false then it turns into helm delete which does not have a skip-crds option.
We're trying to deprecate --args as we can't really relialy determine which args should be passed to which helm commands. So yes, we'd better add native support for those options!
@travisghansen Do you need those options to be configurable within helmfile.yaml? Or maybe you only need that in helmfile template args?
Maybe --no-hooks should be added to just helmfile template. But I'm not yet sure about others.
@Nuru Sorry but I don't know how I'd use --skip-crds. Is it for helm upgrade to prevent any updates to CRDs?
@mumoshu If we want to manage CRDs some other way than with the helm chart we are using to install the program, --skip-crds keeps helm from doing anything with them.
skip-crds: "if set, no CRDs will be installed. By default, CRDs are installed if not already present." It is an option for "install" and "upgrade" and maybe other helm sub-commands.
@Nuru Thanks! Gotcha. So you would probably like to use it from a command-line arg, like helmfile sync --skip-crds, right? There will be no use-case if we make it configurable per release in helmfile.yaml?
Yeah I’m only using template: https://github.com/travisghansen/argo-cd-helmfile/blob/master/src/argo-cd-helmfile.sh
@Nuru Thanks! Gotcha. So you would probably like to use it from a command-line arg, like
helmfile sync --skip-crds, right? There will be no use-case if we make it configurable per release in helmfile.yaml?
@mumoshu On the contrary, I would primarily use it in the helmfile.yaml, because it is part of how I am managing the release of the chart. "For this chart, I am manually managing CRDs, so skip CRDs for the chart." That is why I mentioned createNamespace: I would like a similar skipCRDs option for a release.
@mumoshu This is a bigger problem than I thought, because I cannot use helmfile apply --args --skip-crds because of helm diff.
I'd like to throw out there --include-crds with helm template. I would love this to be included in helmfile.yaml as I am currently having to hardcode helmfile template --args='--include-crds' in my argo-cd gitops pipeline - similar to @travisghansen - and I hate hardcoding that type of thing in automated pipelines for obvious reasons.
Maybe something like this could work (as an easier substitute before a better solution)?
helmDefaults:
args:
template: ["--include-crds"]
apply: ["--skip-crds"]
...
Just like @travisghansen, I was working on integrating Helmfile with ArgoCD, using CustomTool approach of the later to dynamically render results of the Helmfile.
@travisghansen has provided a great script to make that work here, however the Api Versions capabilities do not work, as helm template command expects stringArray of --api-versions command line flag while script is currently passing comma-separated set of versions via single flag
I tried to fork the repository and update bash script logic to pass multiple --api-versions flags in the --args parameter of the helmfile, but now problems seems to be that helmfile is not correctly working with mutiple parameters specified using the same key (as described in https://github.com/roboll/helmfile/issues/457 )
So my current solution to dynamically feed helmfile, invoked via ArgoCD, with apiversions of target cluster is using the new apiVersions section (described in doc under Advanced Configuration: API Capabilities) and requiring the ArgoCD parameter to be set:
apiVersions:
{{- range $apiV := (requiredEnv "KUBE_API_VERSIONS" | split ",") }}
- {{ $apiV }}
{{- end }}
@GolubevV could you open an issue up on my project as well to discuss and possibly fix however best we can currently?
@travisghansen - I can make a PR with a fix to the script that will change behaviour to provide each K8S APi version with a separate dedicated flag.
However, that would not fix the problem completely as some change in the helmfile logic is required to perform correct support for multiple flags with the same key value (--api-versions), provided either via --args or helmDefaults.args to be proxied down to helm template command. Currently, it looks like only the first argument is used, while all others are just dropped ( as described in issue 457 comment)
@mumoshu - For that problem, i am not sure if that should be tracked in this issue, issue #457 or should i create a completely new one?
Just to add some more usecases into the pot. I'm trying to pass --no-hooks to helmfile apply & helm sync both currently fail because they are running a helm command (eg helm list) that doesn't support the --no-hooks flag. @albertrdixon suggestion of name-spacing the helm args would work for my use-case.
@Nuru Thanks! Gotcha. So you would probably like to use it from a command-line arg, like
helmfile sync --skip-crds, right? There will be no use-case if we make it configurable per release in helmfile.yaml?@mumoshu On the contrary, I would primarily use it in the helmfile.yaml, because it is part of how I am managing the release of the chart. "For this chart, I am manually managing CRDs, so skip CRDs for the chart." That is why I mentioned
createNamespace: I would like a similarskipCRDsoption for a release.
Any update on adding support for --skip-crds in the release level (it would be very much appreciated and helpful...)?