#helmfile (2022-03)

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-03-09

KimJohn Quinn avatar
KimJohn Quinn

I am really wrestling with helmfile in application. I think i understand what I can do but the values are killing me.

Using Redis chart as an example:

I have a hemlfile.yaml

bases:
  - ../common.yml
  - environments.yml
---
repositories:
  - name: bitnami
    url: <https://charts.bitnami.com/bitnami>

releases:
  - name: redis
    chart: bitnami/redis
    force: true
    installed: {{ env "REDIS_INSTALLED" | default .Values.installed }}
    version: 16.4.5
    labels:
      managed: true
    values:
      - values.gotmpl

My environments.yml looks like (truncated):

environments:
  default:
    values:
      - ../globals.gotmpl
      - defaults.yml
  develop:
    values:
      - ../globals.gotmpl
      - defaults.yml

And my defaults.yml looks like (i have a production one as well):

installed: true

architecture: standalone
  
master:
  persistence:
    enabled: false

replica:
  persistence:
    enabled: false
  replicaCount: 0

My issues are:

  1. It seems I have to “replicate” the properties inside the values.gotmpl when I would of expected them to be inherited from globals.yml
  2. Just within the Redis chart itself I seem to have to do # 1 as well - even if i get rid of the values.gotmpl I would of expected it to use one of the environment files My values.gotmpl looks like this: ``` architecture: {{ .Values.architecture }}

master: persistence: enabled: {{ .Values.master.persistence.enabled }}

replica: persistence: enabled: {{ .Values.replica.persistence.enabled }} replicaCount: {{ .Values.replica.replicaCount }} ``` And all it is doing is repeating the values from the environment files.

KimJohn Quinn avatar
KimJohn Quinn

The reason I am asking here is because it seems like you are heavy users of Helmfile and honestly the only real resource I seem to be able to locate.

2022-03-14

steenhoven avatar
steenhoven

Does anyone know how to ensure a release is not installed when a flag is set? condition: mychart.disabled ?

voron avatar

use installed: instead of condition:

steenhoven avatar
steenhoven

Thanks. Not sure how to do that based on a condition though. Combine them?

voron avatar

no, just try installed: mychart.installed

voron avatar

AFAIR there is some issue with variables there, but I use installed: true to install a release and installed: false to remove this release with helmfile sync

2022-03-15

2022-03-21

Loukas Agorgianitis avatar
Loukas Agorgianitis

Hello! In my helmfile.yaml I have this:

values:
  - .env.yaml

in order to source all top level {{ .Values }}. Can I somehow make this conditional and check first if the values are defined from –values (or environment variables) and then fall back to this?

2022-03-23

brandon avatar
brandon

Hello. I have a question about the tpl function. Is it possible to have locally defined variables be used within a templated textfile?

# alerting.yaml.gotmpl

{{- $deadMansSwitchEndpoint := printf "myString" }}
receivers:
{{ tpl ( readFile "../prom-rules/alertmanager/alertmanager-receivers.yaml") . }}

Where

# ../prom-rules/alertmanager/alertmanager-receivers.yaml
- name: deadmanswitch
  webhook_configs:
  - url: {{ $deadMansSwitchEndpoint }}
    send_resolved: false
helmfile --file alerting.yaml template

failed to render values files "alerting.yaml.gotmpl": failed to render [alerting.yaml.gotmpl], because of template: stringTemplate:70:3: executing "stringTemplate" at <tpl (readFile "../prom-rules/alertmanager/alertmanager-receivers.yaml") .>: error calling tpl: template: stringTemplate:4: undefined variable "$deadMansSwitchEndpoint"

The only example I see in the docs does not use the $variable syntax. And even then this example is for base helm, and not helmfile. https://helm.sh/docs/howto/charts_tips_and_tricks/

bradym avatar

I don’t think you can use a variable defined outside the file like that, but I’m using tpl to render a template that uses variables set inside the template file.

brandon avatar
brandon

Huh, you’re right. Defining the variable inside of the templated file works.

That’s pretty surprising to me, but I’ll take it.

brandon avatar
brandon

Thanks.

1

2022-03-30

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I’d like to have one step further to maintain Helmfile better, by moving this repository to a GitHub organization https://github.com/helmfile.

This project has originally been created by awesome @roboll and the repository has been owned by him since then. Much appreciation to @roboll about that!

I don’t really mind who literally owns the repository but recently I got some motivation to have administrative privilege on this repo myself to do:

• Enable and use GitHub Discussions for better place to discuss about ideas and get community support • Enable Stale(https://github.com/apps/stale) to help to triage ever-growing number of issues remaining abandoned/unanswered. • Enable and use GitHub Actions for CI • Setup a documentation site #1755

A side benefit of moving to our own organization would be that we now have the ability to add more maintainers. As we are not funded or sponsored as a group/organization, I guess no one would like to afford one’s spare time like I do to maintain Helmfile. But if anyone is interested in helping Helmfile as an additional maintainer, reach me out after we successfully moved to an org.

I’ve also wondered if moving this repository to my own GitHub account (possible only when roboll agrees, of course). But my account is already super crowded with many projects making it harder to reach Helmfile, and I see no clear benefit for the community having it under my GitHub account. I’d go with a GitHub organization then.

Note that this doesn’t relate to, or affect our potential move to CNCF/Helm org #758. I’ll keep considering moving to CNCF/Helm because it would provide some (still vague) user benefit.

But in the shorter-term though, what I want is something that helps me maintaining Helmfile easier and more efficiently today, hence moving to our own GitHub organization.

If there’s no strong objection, I’d really like this to happen. If you could leave any comments, it would be great.

Anyway, I’ll start by talking with @roboll about it’s something He wants to do in the first place.

bradym avatar

Here’s hoping GitHub comes back with a useful answer to momushu’s inquiry.

I’d like to have one step further to maintain Helmfile better, by moving this repository to a GitHub organization https://github.com/helmfile.

This project has originally been created by awesome @roboll and the repository has been owned by him since then. Much appreciation to @roboll about that!

I don’t really mind who literally owns the repository but recently I got some motivation to have administrative privilege on this repo myself to do:

• Enable and use GitHub Discussions for better place to discuss about ideas and get community support • Enable Stale(https://github.com/apps/stale) to help to triage ever-growing number of issues remaining abandoned/unanswered. • Enable and use GitHub Actions for CI • Setup a documentation site #1755

A side benefit of moving to our own organization would be that we now have the ability to add more maintainers. As we are not funded or sponsored as a group/organization, I guess no one would like to afford one’s spare time like I do to maintain Helmfile. But if anyone is interested in helping Helmfile as an additional maintainer, reach me out after we successfully moved to an org.

I’ve also wondered if moving this repository to my own GitHub account (possible only when roboll agrees, of course). But my account is already super crowded with many projects making it harder to reach Helmfile, and I see no clear benefit for the community having it under my GitHub account. I’d go with a GitHub organization then.

Note that this doesn’t relate to, or affect our potential move to CNCF/Helm org #758. I’ll keep considering moving to CNCF/Helm because it would provide some (still vague) user benefit.

But in the shorter-term though, what I want is something that helps me maintaining Helmfile easier and more efficiently today, hence moving to our own GitHub organization.

If there’s no strong objection, I’d really like this to happen. If you could leave any comments, it would be great.

Anyway, I’ll start by talking with @roboll about it’s something He wants to do in the first place.

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

This project is so big now - wouldn’t be surpised if GitHub uses it even

    keyboard_arrow_up