#helmfile (2022-08)

https://github.com/helmfile/helmfile

Questions and discussion around helmfile https://github.com/roboll/helmfile and https://github.com/cloudposse/helmfiles

Archive: https://archive.sweetops.com/helmfile/

2022-08-01

2022-08-03

Andrew Nazarov avatar
Andrew Nazarov

We’re thinking how we can use helmfile to add a new object definition to a third-party chart we have no control over. I know that it should be possible, but can’t find any examples. Appreciate any help)

voron avatar

Oblivious option is to use raw chart to deploy raw manifests + helmfile dependencies. But it may not suit your needs. I have some ugly example of strategicMergePatches to patch resulting yaml on the fly:

  - name: test0
    namespace: test0
    createNamespace: true
    chart: dysnix/nginx
    wait: false
    waitForJobs: false
    atomic: false
    values:
      - values/test0.yaml.gotmpl
    strategicMergePatches:
      - apiVersion: apps/v1
        kind: Deployment
        metadata:
          name: test0-nginx
        spec:
          template:
            spec:
              initContainers:
                - name: sleep
                  image: alpine:latest
                  imagePullPolicy: "IfNotPresent"
                  command:
                    - /bin/sh
                    - -c
                    - sleep 7200
Andrew Nazarov avatar
Andrew Nazarov

Yes, I definitely have a raw chart solution in my mind, but thought that maybe there would be a more elegant solution to treat the whole thing as a bundle.

In your example it seems this dysnix/nginx has a Deployment object, right, and you just mutate it? We tried with strategicMergePatches: with a new object and helmfile threw an error: failed to find unique target for patch

voron avatar

yes, strategicMergePatches works w/ existing object only

Andrew Nazarov avatar
Andrew Nazarov

Yeah, that’s what I thought. It seems the less cryptic way would be, as you mentioned, a new release with an additional object even though I would like to avoid it. Thanx!

1

2022-08-04

Moath avatar

Hi All, How can I add an already deployed helm chart to be managed by helmfile? Thank you!

voron avatar

Hi, you may try to write a helmfile release using values from deployed helm chart helm get values <release-name>

    keyboard_arrow_up