#helmfile (2023-05)

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/

2023-05-01

Jacob Amar avatar
Jacob Amar

hi all, i was wondering how would you work in a huge team of 15 engineers with helmfile? because if we have multiple clusters and now one engineer need to work on prometheus values and the other one working on argocd we are locking each other

yxxhero avatar
yxxhero

@Jacob Amar maybe you can use an independent helmfile per project?

2023-05-02

Martin Dulák avatar
Martin Dulák

Hello everyone! I have a question regarding helmfile diff I want to use helmfile to regularly check whether my cluster is up-to-date with my Git. What I have done:

  1. Install Nginx Ingress ``` repositories:

releases:

  • name: nginx-ingress chart: ingress-nginx/ingress-nginx version: 4.4.2 namespace: system values:
    • nginx-ingress.yaml ``` 2. Manually change number of replicas of nginx controller in my cluster.
  1. Run helmfile diff

When I do this, no changes are detected. Is this a feature or a bug? Am I overlooking something? Many thanks!

Tim Birkett avatar
Tim Birkett

Helm only makes a comparison against the Helm release object in the cluster. Not the running state of the resources it creates.

1
Tim Birkett avatar
Tim Birkett

You could do something like: helmfile template | kubectl -n system diff - but I’d just not make changes to resources in the cluster directly.

1
Martin Dulák avatar
Martin Dulák

That’s unfortunate as the command you proposed prints a lot of changes, even when comparing the helmfile with the just-installed release. I’d expect zero changes reported in this case.

diff -u -N /tmp/LIVE-4028358175/admissionregistration.k8s.io.v1.ValidatingWebhookConfiguration..cert-manager-webhook /tmp/MERGED-3331766146/admissionregistration.k8s.io.v1.ValidatingWebhookConfiguration..cert-manager-webhook
--- /tmp/LIVE-4028358175/admissionregistration.k8s.io.v1.ValidatingWebhookConfiguration..cert-manager-webhook   2023-05-03 09:58:12.292005900 +0200
+++ /tmp/MERGED-3331766146/admissionregistration.k8s.io.v1.ValidatingWebhookConfiguration..cert-manager-webhook 2023-05-03 09:58:12.293072200 +0200
@@ -6,7 +6,7 @@
...

2023-05-03

Dominic Cardellino avatar
Dominic Cardellino

Hey again,

Posting this here hoping to get a quick response. I try to template my alertmanager config (kube-prometheus-stack) with helmfile. I have configured a (not that special) slack message template and i am not able to deploy the application. The values.yaml looks something like this:

alertmanager:
  config:
    receivers:
      - name: 'slack'
        slack_configs:
          - send_resolved: true
            api_url: <redacted
            username: AlertManager
            title: "{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}"
            text: "{{ range .Alerts }}{{ .Annotations.description }}\n{{ end }}"

and if i run helmfile diff/apply i get the following error:

in ./helmfile.yaml: in .helmfiles[3]: in releases/04-prometheus/helmfile.yaml: failed processing release kube-prometheus-stack: failed to render values files "values.yaml.gotmpl": failed to render [values.yaml.gotmpl], because of template: stringTemplate:55:29: executing "stringTemplate" at <.Alerts>: can't evaluate field Alerts in type state.releaseTemplateData

Somebody got a similar issue?

bradym avatar

I ran into the same thing with the helmfile + alertmanager combo. Since alertmanager also uses golang templating, you need helmfile rendering to spit out valid golang templating for alertmanager.

This should do the trick:

alertmanager:
  config:
    receivers:
      - name: 'slack'
        slack_configs:
          - send_resolved: true
            api_url: <redacted
            username: AlertManager
            title: "{{`{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}`}}"
            text: "{{`{{ range .Alerts }}{{ .Annotations.description }}\n{{ end }}`}}"
bradym avatar

Just wrapping the alertmanager template in:

{{` `}}
Dominic Cardellino avatar
Dominic Cardellino

I will try thx

Dominic Cardellino avatar
Dominic Cardellino

@bradym It worked all! Nice and thank you mate!

1

2023-05-04

    keyboard_arrow_up