#helmfile - March 2025

Carlo Sciolla
Carlo Sciollaover 1 year ago
hey hey everyone! I'm struggling a bit with using helmfile when deploying the opensearch chart, where I need to set the javaOpts to something like -Xms16g -Xmx16g. I put such value in each environment yaml (note: we use the value using the {{ .Environment.Values.openSearchJavaOpts }}), but when helmfile goes to deploy stuff, it translates our configuration as follows:

helm template ... --set opensearchJavaOpts=-Xms16g -Xmx16g

which obviously doesn't work as it interprets the part after the space as a shorthand flag for helm itself. I tried various ways to encode the value, hoping to be able to pass that whole string as a single value but nothing worked, the string is always unquoted during the helm template invocation, triggering the issue. Any ideas?

Thanks in advance for any suggestion 🙇

disclaimer: we are using forceNamespace: true as without it everything is deployed on the default namespace, which we don't want
PULKIT PAL
PULKIT PALover 1 year ago
Here attached some great resource for linux and kubernetes.

https://github.com/Pulkit12966/redhat_official_studyguide_RHCSA
Toby Jackson
Toby Jacksonover 1 year ago
Hi,

I'm trying to understand how i can deploy different versions of charts to different environments.

For instance, I want to have a qa environment use a newer version of a chart for testing compatibility ahead of rolling the chart to a prod environment.

I've tried a few approaches, but i'm stuck trying to work it out.

The most sensible sounding approach (generated by AI i think) was; https://gurubase.io/g/helmfile/different-chart-versions-helmfile-environments where i pop;

releases:
  - name: myapp
    chart: stable/mychart
    version: {{ .Environment.Values.mychart.chartVersion }}

but every time i try and run helmfile build qa i get an error;
in ./helmfile.yaml: error during helmfile.yaml.part.1 parsing: template: stringTemplate:20:29: executing "stringTemplate" at <.Environment.Values.mychart.chartVersion>: map has no entry for key "mychart"

Has anyone got any suggestions on how to deal with per-env chart versioning?
Ivo
Ivoover 1 year ago(edited)
I'm trying to get rid of all CustomResourceDefinition resources from helmfile template via patches. I think it should be possible with '$patch: delete' and a regex selector for the name of the CRD but helmfile errors out with a message that no resources can be found. If I use an exact name, it works. I'm using this patch:
  strategicMergePatches:
  - apiVersion: apiextensions.k8s.io/v1
    kind: CustomResourceDefinition
    metadata:
      name: .*
    $patch: delete

Does helmfile work differently and does it not support regex matches on the name? If so, how do I target multiple resources with some kind of wildcard? I'm basing this on https://github.com/kubernetes-sigs/kustomize/blob/master/examples/patchMultipleObjects.md Also, it seems that name is somehow mandatory when using it with Helmfile but from the above link it seems that name is optional?
Ivo
Ivoover 1 year ago
Maybe I should focus more on Kustomize itself. It seems that a name is required but regex matching doesn't work for some reason.
Germain GAU
Germain GAUover 1 year ago
Hi everyone !
I recently had to fiddle with implementing the Scaleway provider for vals, here is a (very crude) first draft : https://github.com/Xide/vals/tree/feat/scaleway-secret-manager
I was wondering if you were open to the addition of this new provider upstream. If so, i think i can open the PR by the end of week (need some time to implement test & docs).
Thanks