-
Notifications
You must be signed in to change notification settings - Fork 566
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
feat: experimental integration with helm-x #673
Conversation
This enhances helmfile so that it can: - Treat K8s manifests directories and Kustomize projects as charts - Add adhoc chart dependencies on sync/diff/template without forking or modifying chart(s) (#649) - Add adhoc patches(JSON Patch or Strategic Merge Patch supported) to be applied to the K8s resources before sync/diff/template, without forking or modifyin chart(s) (#650) The usage is as outlined in https://github.com/mumoshu/helm-x/tree/master/examples/helmfile. Add any or all of `dependencies:`, `jsonPatches:` and `strategicMergePatches:` so that it adds additional flags to `helm` calls that is only supported by `helm x`. ```yaml releases: - name: kustomize chart: ../kustomize - name: manifests chart: ../manifests - name: foo chart: incubator/raw dependencies: - alias: bar chart: incubator/raw values: - values.yaml - bar: enabled: true resources: - apiVersion: v1 kind: Pod metadata: name: bar spec: containers: - command: - sleep - 1000 image: alpine:3.9.4 imagePullPolicy: IfNotPresent name: bar jsonPatches: - target: version: v1 kind: Pod name: foo patch: - op: replace path: /spec/containers/0/command value: - sleep - "123" strategicMergePatches: - apiVersion: v1 kind: Pod metadata: name: bar spec: containers: - name: bar command: - sleep - "234" ``` You can alternatively provide `source: path/to/patch.yaml` for `jsonPatches` and `strategicMergePatches` items to externalize it. Add `.gotmpl` suffix like you would do for values files for templating. When running `helmfile` you must point `--helm-binary` to the `helm-x` binary like below: ``` $ helmfile --helm-binary ~/.helm/plugins/helm-x/bin/helm-x --log-level debug apply ``` after installing the [helm-x](https://github.com/mumoshu/helm-x) plugin. The integration should ideally be automatic. That is, it shouldn't force you to set `--helm-binary`. But I had no other way to not bloat helmfile's codebase to just add this experimental feature. Resolves #649 Resolves #650
Maybe will be useful for someone. Helm-x latest version is not working on mac, so I had to install 0.7.2 not to get any errors and to see manifest functionality working properly. And you can't use manifest directly, you have to put it in a folder and specify folder path. Finally, 0.7.2 version doesn't seem to respect chart version and installs latest instead but it's acceptable for me for now. To be more specific, my current setup:
Too bad, 0.7.2 has some troubles with dependency files:
|
hi @mumoshu
|
@yuri-1987 Hey! Reading your logs, I guess you should use |
This is the GA version of the helm-x integration #673 developed last year. You get all the following benefits without an extra helm plugin: - Ability to add ad-hoc chart dependencies/aliases, without forking the chart (Fixes #876 ) - Ability to patch resulting K8s resources before installing the helm chart - Ability to install a kustomization as a chart (Requires `kustomize` binary to be available in `$PATH` - Ability to install a directory of K8s manifests as a chart - etc.
thanks @mumoshu, i moved to helmfile 0.118.0
|
Hi guys,
|
hi @msutter, afaik from version 0.118.0 helm-x functionality is already inside helmfile's code, can you try to run it without the |
Thanks @yuri-1987, I didn't notice the integration. @mumoshu any plans to integrate more kustomize transformers like commonLabels & commonAnnotations ? By the way thanks a lot for this great piece of software. |
@msutter Not yet, but I believe they worth dedicated feature requests to Helmfiel! Would you mind creating those issues, so that I won't forget adding them? |
It seems like helmfile is completely ignoring the contents of the jsonPatches section for me. It sees that section because if I misspell jsonPatches it errors out but the content of that section is ignored. For instance:
does not provoke a complaint and has no effect. Valid patches content is also ignored. I'm trying to modify loose manifests, does it only work for helm charts? |
Yes. But that's being fixed via #1437 |
hm, when is the fix released? @mumoshu |
This enhances helmfile so that it can:
The usage is as outlined in https://github.com/mumoshu/helm-x/tree/master/examples/helmfile.
Add any or all of
dependencies:
,jsonPatches:
andstrategicMergePatches:
so that it adds additional flags tohelm
calls that is only supported byhelm x
.You can alternatively provide
source: path/to/patch.yaml
forjsonPatches
andstrategicMergePatches
items to externalize. Add a.gotmpl
suffix like you would do for values files to enable templating.To make this feature work, you must point
--helm-binary
to thehelm-x
binary like below:The easiest way to grab the helm-x binary is to install it as a helm plugin:
See helm-x for more details on it.
The integration should ideally be automatic. That is, it shouldn't force you to set
--helm-binary
. But I had no other way to not bloat helmfile's codebase to just add this experimental feature.Resolves #649
Resolves #650