#helmfile - September 2023

September 2023
jz
jzabout 3 years ago
Hi, I have trouble getting values from environment to my chart. Did I miss something ?
(Helm 3.12.3, Helmfile 0.156.0)

/helmfile.yaml
...
environments:
  staging:
    values:
      - fromEnv: HelloFromEnv
releases:
- name: ...
  ...
  values:
    ...
    - fromRelease: HelloFromRelease

/charts/myChart/templates/deployment.yaml
...
testFromRelease: {{ .Values.fromRelease }}
testFromEnv: {{ .Values.fromEnv }}

Command helmfile template -e staging results in:
testFromEnv: null
testFromRelease: HelloFromRelease
Phil Chen
Phil Chenabout 3 years ago
I'm struggling with a simple helmfile where I would like control which release should be installed in a given env. Here is the exmaple helmfile.yaml file:

environments:
dev:
values:
- dev.env.yaml
staging:
values:
- staging.env.yaml
prod:
values:
- prod.env.yaml
---
repositories:
- name: prometheus-community
url: https://prometheus-community.github.io/helm-charts

releases:
- name: kube-prometheus-stakc
namespace: prometheus
chart: prometheus-community/{{{{ .Release.Name }} }}
version: 30.3.1
installed: {{ .Values.prometheus.enabled }}
Phil Chen
Phil Chenabout 3 years ago
In addition, I have env specific values file. For example: dev.env.yaml like this:

prometheus:
enabled: True
Phil Chen
Phil Chenabout 3 years ago
When run this command:

helmfile template -e dev

I got this error:
in ./helmfile.yaml: failed to read helmfile.yaml: reading document at index `: yaml: invalid map key: map[interface {}]interface {}[".Values.prometheus.enabled":interfac {}<nil>}
Phil Chen
Phil Chenabout 3 years ago
I tried change this line to this but it does work either:

installed: {{ `{ .Values.prometheus.enabled }} ` }}
Phil Chen
Phil Chenabout 3 years ago
What am I missing? Thanks in advance for help tips.
Phil Chen
Phil Chenabout 3 years ago
I have multiple clusters. Not all of them will have the same charts installed. To be DRY, I created a common helmfile which contains common charts that I would like to install for all clusters. IWhat is the recommended best practice for combining this common helmfile with the cluster specific helmfile?
Phil Chen
Phil Chenabout 3 years ago
I have a few simple k8s manifest files and what is the simplist way to deploy them with helmfile?
Sean
Seanabout 3 years ago
FYI: helmfile now supports symlinks: https://github.com/helmfile/helmfile/pull/1020