#helmfile (2024-02)

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/

2024-02-01

2024-02-07

CraigB avatar

Is there a way to prevent deletion of charts downloaded by helmfile? I can see options to preserve the values files but not the charts themselves

Balazs Varga avatar
Balazs Varga

We store them on our own repo and when we use a 3rdparty, then we cache it in our own env.

2024-02-15

Rafael Or avatar
Rafael Or

Hi everyone, I realized that when templating with helmfile template --skip-deps the dependencies added in the helmfile.yaml file are not skipped. I have found this open issue https://github.com/helmfile/helmfile/issues/1317, and I have seen this piece of code in chartify.go//github.com/helmfile/chartify/blob/31fe0cba35ae1a33ea40e2ae40fe22052693786e/chartify.go#L364-L391> if you take a look there, we can modify the if condition. This will fix the issue:

if u.SkipDeps && len(u.AdhocChartDependencies) == 0  -> if u.SkipDeps || len(u.AdhocChartDependencies) == 0 
Rafael Or avatar
Rafael Or

I mean, helm dep update will never update the dependencies inside the helmfile.yaml, so maybe we can create a new parameter like –skip-release-deps

Igor Rodionov avatar
Igor Rodionov

The GitHub issue comments are the right place for that discussion. Also, you can tag @mumoshu as the helmfile maintainer.

2024-02-18

yxxhero avatar
yxxhero

New feature

• add suppress output line regex support by @yxxhero in #1329

• see more: https://github.com/helmfile/helmfile/blob/v0.162.0/test/integration/test-cases/suppress-output-line-regex/input/helmfile.yaml.gotmpl

helmDefaults:
  suppressOutputLineRegex:
    - "helm.sh/chart"
    - "app.kubernetes.io/version"

repositories:
- name: ingress-nginx 
  url: <https://kubernetes.github.io/ingress-nginx>

releases:
- name: ingress-nginx
  namespace: ingress-nginx
  chart: ingress-nginx/ingress-nginx
  version: {{ env "SUPPRESS_OUTPUT_LINE_REGEX_INGRESS_NGINX_VERSION" | default "4.8.3" }} 
2

2024-02-19

CraigB avatar

Hello, just wondering what strategies people use to make sure that charts/releases are deployed before others? I use sub helmfiles to group charts by functional area and use a numeric naming convention to ensure that dependent charts are deployed first but I’d like to make sure that dependent charts get updated first (potentially with a specific chart version) so that there’s no race conditions on starting pods. Would using the helmDefault wait on the dependent charts mean that Helmfile would not proceed until those charts resources have been changed?

CraigB avatar

Unfortunately needs doesn’t work when the releases are split across multiple helmfiles https://github.com/helmfile/helmfile/issues/1165

#1165 Issue with release dependencies with `needs` and multiple files

Operating system

MacOS 13.6.1

Helmfile Version

v0.158.1

Helm Version

v3.13.2

Bug description

helmfile fails to find release dependencies when using multiple files, using attached sample files:

$ helmfile -f helmfile-all.yaml list
NAME     	NAMESPACE	ENABLED	INSTALLED	LABELS	CHART                      	VERSION
release-1	default  	true   	true     	      	ingress-nginx/ingress-nginx	4.8.1
release-2	default  	true   	true     	      	ingress-nginx/ingress-nginx	4.8.1
$ helmfile -f helmfile-all.yaml lint
Adding repo ingress-nginx <https://kubernetes.github.io/ingress-nginx>
"ingress-nginx" has been added to your repositories

Fetching ingress-nginx/ingress-nginx
Fetching ingress-nginx/ingress-nginx
Linting release=release-1, chart=/var/folders/rh/z33gzdts36bb722jk1wmwdwr0000gn/T/helmfile1003781602/default/release-1/ingress-nginx/ingress-nginx/4.8.1/ingress-nginx
==> Linting /var/folders/rh/z33gzdts36bb722jk1wmwdwr0000gn/T/helmfile1003781602/default/release-1/ingress-nginx/ingress-nginx/4.8.1/ingress-nginx

1 chart(s) linted, 0 chart(s) failed

Linting release=release-2, chart=/var/folders/rh/z33gzdts36bb722jk1wmwdwr0000gn/T/helmfile1003781602/default/release-2/ingress-nginx/ingress-nginx/4.8.1/ingress-nginx
==> Linting /var/folders/rh/z33gzdts36bb722jk1wmwdwr0000gn/T/helmfile1003781602/default/release-2/ingress-nginx/ingress-nginx/4.8.1/ingress-nginx

1 chart(s) linted, 0 chart(s) failed

But when the release-1 is moved to a separate file:

$ helmfile -f helmfile-split.yaml list
NAME     	NAMESPACE	ENABLED	INSTALLED	LABELS	CHART                      	VERSION
release-1	default  	true   	true     	      	ingress-nginx/ingress-nginx	4.8.1
release-2	default  	true   	true     	      	ingress-nginx/ingress-nginx	4.8.1
$ helmfile -f helmfile-split.yaml lint
Adding repo ingress-nginx <https://kubernetes.github.io/ingress-nginx>
"ingress-nginx" has been added to your repositories

Fetching ingress-nginx/ingress-nginx
Linting release=release-1, chart=/var/folders/rh/z33gzdts36bb722jk1wmwdwr0000gn/T/helmfile1196831173/default/release-1/ingress-nginx/ingress-nginx/4.8.1/ingress-nginx
==> Linting /var/folders/rh/z33gzdts36bb722jk1wmwdwr0000gn/T/helmfile1196831173/default/release-1/ingress-nginx/ingress-nginx/4.8.1/ingress-nginx

1 chart(s) linted, 0 chart(s) failed

Fetching ingress-nginx/ingress-nginx
in ./helmfile-split.yaml: release(s) "default/release-2" depend(s) on an undefined release "default/release-1". Perhaps you made a typo in "needs" or forgot defining a release named "release-1" with appropriate "namespace" and "kubeContext"?

Example helmfile.yaml

helmfile-all.yaml:

repositories:
  - name: ingress-nginx
    url: <https://kubernetes.github.io/ingress-nginx>

releases:
  - chart: ingress-nginx/ingress-nginx
    version: 4.8.1
    name: release-1
    namespace: default
  - chart: ingress-nginx/ingress-nginx
    version: 4.8.1
    name: release-2
    namespace: default
    needs:
      - release-1

helmfile-split.yaml:

repositories:
  - name: ingress-nginx
    url: <https://kubernetes.github.io/ingress-nginx>

helmfiles:
  - helmfile-release-1.yaml

releases:
  - chart: ingress-nginx/ingress-nginx
    version: 4.8.1
    name: release-2
    namespace: default
    needs:
      - release-1

helmfile-release-1.yaml:

repositories:
  - name: ingress-nginx
    url: <https://kubernetes.github.io/ingress-nginx>

releases:
  - chart: ingress-nginx/ingress-nginx
    version: 4.8.1
    name: release-1
    namespace: default

Error message you’ve seen (if any)

in ./helmfile-split.yaml: release(s) "default/release-2" depend(s) on an undefined release "default/release-1". Perhaps you made a typo in "needs" or forgot defining a release named "release-1" with appropriate "namespace" and "kubeContext"?

Steps to reproduce

Given in the issue description, but basically helmfile -f helmfile-split.yaml lint.

Working Helmfile Version

(none)

Relevant discussion

No response

Andrew Nazarov avatar
Andrew Nazarov

It also could be achieved with labels/selector (this way we define so called dependency tiers). But to apply configurations we need several sequential helmfile apply commands. I don’t like it much, however we sometimes have to do it this way. We also use needs, but for other purposes (even though somewhat similar)

2024-02-26

2024-02-28

Bastien avatar
Bastien

Hello everyone. I have a question about helmfile. I hope you can help me

Is there a way to tell helmfile to override the values coming from the helm chart instead of merging them ? 

Typically I have something like

parent:
  value1: toto
  value2: tata

in the default values.yaml of the chart

In my helmfile config I defined something like

parent:
  value3: titi

The end result is something like

parent:
  value1: toto
  value2: tata
  value3: titi

The only solution I found is to explicitely set the parent chart values to undefined like :

parent:
  value1:
  value2:

Is this the way to go ?

Bastien avatar
Bastien

Another detail. In my case if I run a helmfile write-values I only see the values from the helmfile config. Not the one coming from the chart. But in my using helmfile template I can see that it uses the values from the chart. Which is very unintuitive.

Bastien avatar
Bastien

helmfile version v0.162.0

CraigB avatar

@Bastien you might need to provide more info on what you’re trying to achieve as it’s not clear why you would want the behaviour you describe. At the end of the day, the values are just a map of values, it’s what you do with them in your chart that matters. So you can implement conditional logic to select the appropriate value. But equally, value3 is not value1 or value2 so merging them should be fine. If you really want overwriting, then pass value1 or value2 in from the helmfile config too.

Bastien avatar
Bastien

Thank you @CraigB for the answer.

Yes actually I’m currently testing helmfile at my work. I was planning to use the values.yaml hosted in our chart repository as a sort of example configuration with comments describing what we can set in it. So value1 and value2 in my use case are not wanted because in my chart in this case I will iterate on the values under parent to create new k8s deployments manifest.

And do you have an idea why we don’t see the values coming from the chart when we run helmfile write-values. I understood that this command was computing the merged values file, so I was expecting to see the one coming from the chart too.

CraigB avatar

@Bastien Sorry I’m not familiar with write-values

    keyboard_arrow_up