helmfile icon indicating copy to clipboard operation
helmfile copied to clipboard

Support for helm's post-renderer flag

Open Nitive opened this issue 5 years ago • 3 comments

Hello! We are using our own post-renderer with helm. It creates resources from JS files. We are basically writing charts using JavaScript. There are currently no easy way to integrate it with helmfile.

I want to add to helmfile ability to specify post-renderer, so I've written proposal how it may look like. There are no difference with how other helm flags implemented. If everything looks good let me know and I'll start working on a PR.

Such functionality was already discussed in #1351, but since it was more about kustomize, not generic post-renderer, I've decided to create a new issue.

Proposal

Ability to specify post-renderers for release

releases:
  - name: vault
    namespace: vault
    postRenderers:
      - ./path/to/post-renderer

Ability to specify post-renderers for all releases

helmDefaults:
  postRenderers:
    - ./path/to/post-renderer

Ability to reset default post-renderers

releases:
  - name: vault
    namespace: vault
    postRenderers: [] # or null

helmDefaults:
  postRenderers:
    - ./path/to/post-renderer

Path to post-renderer can be be

  1. absolute (starts with /) — then it will be passed to helm as-is
  2. relative (starts with ./) — then it will be prepended with helmfile.yaml dir path and then passed to helm
  3. Other — then it will be passed to helm as-is, assuming the executable exists in the PATH

Also it might be nessecary to add some extra validation if post-renderer executable exists.

--post-renderer flag (or flags) will be passed to commands:

  1. helm diff
  2. helm template
  3. helm upgrade

If installed helm version does not support post-renderer, the error will be displayed. The same with helm-diff (when helmfile diff/apply used)

Nitive avatar Oct 12 '20 16:10 Nitive

Hi, I think that you can use args to work around it. I have another use case for it - automatic upgrade of resources before applying by kubectl convert. Thanks

AssafKatz3 avatar Feb 15 '22 07:02 AssafKatz3

@AssafKatz3 Thanks for sharing! --args isn't well-designed so i wont recommend using it as written at https://github.com/roboll/helmfile/issues/1804#issuecomment-1039975686, but if it works... go ahead.

BTW, I'd welcome any contributions towards adding a post-renderer support to helmfile.

mumoshu avatar Feb 15 '22 08:02 mumoshu

Seems like #510 fixed this.

reegnz avatar Sep 15 '23 12:09 reegnz