#helmfile - June 2019

Andrew Nazarov
Andrew Nazarovover 7 years ago
Is it expected that helmfile ignores kubeContext if it doesn’t exist? I just noticed that behaviour, haven’t doublechecked it though.
mumoshu
mumoshuover 7 years ago
not expected. helmfile just passes it to helm commands so I’d expect helm should fail if the kubeContext you’ve provided and then passed by helmfile doesn’t exist!
Andrew Nazarov
Andrew Nazarovover 7 years ago
I’m using helm tiller plugin, btw. Well, I’ll check it out again and create an issue.
Andrew Nazarov
Andrew Nazarovover 7 years ago
Can variables taken from environments like {{ .Environment.Values.imageTag }} be rendered from helmfile.yaml? For some reason it always shows me <no value>. Am I missing something? From the docs it should work, but…
Andrew Nazarov
Andrew Nazarovover 7 years ago
However {{ .Environment.Name }} is rendered correctly.
Andrew Nazarov
Andrew Nazarovover 7 years ago
It seems it doesn’t work when I have bases: defined. Probably I’ve read about that in some thread or issue….
mumoshu
mumoshuover 7 years ago
The “remote helmfiles” feature is coming! I’d appreciate it if you could test it out: https://github.com/roboll/helmfile/pull/648
mumoshu
mumoshuover 7 years ago
especially @Erik Osterman (Cloud Posse) 😃
Andrew Nazarov
Andrew Nazarovover 7 years ago
Does helmfile has some sort of global timeout somewhere?

I’ve got “ERROR: Job failed: execution took longer than 1h0m0s seconds”. As for helm operations the timeout is set to 1200 sec via helmDefaults. The execution of tillerless approach is much longer especially when we have failing releases.
Erik Forsberg
Erik Forsbergover 7 years ago
Hi! The example helmfile refers to a helm-git plugin. I can only find a helm-git plugin that takes github/gitlab URLs, not git+https - so a link to this plugin would be appreciated.
Erik Forsberg
Erik Forsbergover 7 years ago
Another question: The docs says I need to disable concurrency if I run with tillerless. Is there a way to do this from configuration file, (i.e. the helmfile.yaml), or only from commandline?
Andrew Nazarov
Andrew Nazarovover 7 years ago
A bit more about concurrency. It would be great to have --concurrency flag defined in docs and in help output of helmfile.
SeB
SeBover 7 years ago
Hi guys,
I have a template issue, I’d like to have in a release the “chart: ” value to be computed according to the version set in environment so that when :
• the version has some value like “0.1.3" the chart definition is chart: myregistry/mychart
• the version is empty or not set the chart def is a local chart chart: ../mychart
I thought that the following would work
environments:
  dev:
    values:
      - tpsvc-configVersion: ""
  prod:
    values:
      - tpsvc-configVersion: 1.0


templates:
  chart: &chart
    {{- $versionKey := printf "%sVersion" `{{.Release.Name}}` }}
    chart: {{ .Environment.Values | get ($versionKey) "" | eq "" | ternary "../.." "talend" }}/{{`{{.Release.Name}}`}}
    version: {{.Environment.Values | get ($versionKey) ""}}

releases:
- name: tpsvc-config
  <<: *chart

But it does not
SeB
SeBover 7 years ago
Do you have any idea to solve this, if it is even possible.
Andrew Nazarov
Andrew Nazarovover 7 years ago
During the aforementioned conversation I thought about the following.
I was wondering if something like this is possible with helmfile (forgive me for the syntax I don’t know how to show embedded part):
{{ .Environment.Values.{{ .Release.Name }}.version }}?

Is there any chance to have that sort of templating? Or it just makes no sense?
SeB
SeBover 7 years ago(edited)
I don’t understand why when I do this the rendering fails
releases:
- name: tpsvc-config
  chart: {{ `{{ .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }}` }}/{{`{{.Release.Name}}`}}
SeB
SeBover 7 years ago
with an error err: failed to read helmfile.config.yaml: reading document at index 1: yaml: line 15: did not find expected key
SeB
SeBover 7 years ago(edited)
but when I do this
releases:
- name: tpsvc-config
  chart: ../{{`{{.Release.Name}}`}}

This renders properly‹
Andrew Nazarov
Andrew Nazarovover 7 years ago
What if you try without get? The same pipeline but with .Environment.Values.tpsvc-configVersion? Sorry for interfering again, I just find your approach useful for one of my use cases.
SeB
SeBover 7 years ago
I’ll try but this should not be any different.
SeB
SeBover 7 years ago
and also this will fail cause value resolution does not support a dash in the values 😞
mumoshu
mumoshuover 7 years ago
Not sure what’s causing your confusion exactly, but try:


releases:
- name: tpsvc-config
  chart: |
    {{`{{ .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }}` }}/{{`{{.Release.Name}}`}}
SeB
SeBover 7 years ago
Hi @mumoshu thanks a lot ! this is working but I have another issue though. The version of a release seem not to accept templatization
releases:
- name: tpsvc-config
  chart: |
    {{ `{{  .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }}` }}/{{`{{.Release.Name}}`}}
  version: |
    {{` {{ .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" }}` }}
SeB
SeBover 7 years ago
it is failing with :
  Error: chart "tpsvc-config" matching {{ .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" }} not found in talend index. (try 'helm repo update'). improper constraint: {{ .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" }}
mumoshu
mumoshuover 7 years ago
Ah, that sounds like not implemented!
mumoshu
mumoshuover 7 years ago
// hold on..
SeB
SeBover 7 years ago
yep
SeB
SeBover 7 years ago
it seems that the version is missing here 🙂
mumoshu
mumoshuover 7 years ago
You found it!
SeB
SeBover 7 years ago
Do you want me to create an issue ?
mumoshu
mumoshuover 7 years ago
Please do so! It’s even nicer if you directly create a PR to add it 🙂
SeB
SeBover 7 years ago
yep I know 🙂
SeB
SeBover 7 years ago
I’ll try to find some time tonight
SeB
SeBover 7 years ago(edited)
SeB
SeBover 7 years ago
thank anyway for the “|” tip, yaml is always a mystery for me.
Andrew Nazarov
Andrew Nazarovover 7 years ago
Wow, it’s great to know about “I”.
SeB
SeBover 7 years ago
@mumoshu can you explain why the | is required for this scalar, why the initial string does not work. is it because the the ” inside the string ?
SeB
SeBover 7 years ago
I have made it work using the simple quote to surround the string like
  chart: '{{ `{{  .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }}`'
SeB
SeBover 7 years ago
it fails using the double quote even with the inside double quote escaped ?
mumoshu
mumoshuover 7 years ago
@SeB That’s basically due to that {{ whatever }}//{{ whatever }} isn’t a valid yaml string
mumoshu
mumoshuover 7 years ago

chart: {{` {{  .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }} ``}


evaluates to


chart: {{  .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }}


which looks chart: {{ whatever }}//{{ whatever }} for the yaml parser
mumoshu
mumoshuover 7 years ago

chart: '{{ `{{  .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }}`}}'


this works cuz it evaluates to:


chart: '{{  .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }}'


which looks chart: 'str' to the yaml parser
SeB
SeBover 7 years ago
ok thanks a lot for the explanation
mumoshu
mumoshuover 7 years ago

chart: "{{` {{  .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }} `}}"


and this is close but doesn’t work in your case as you have " in release tempaltes
mumoshu
mumoshuover 7 years ago(edited)
it evaluates to


chart: "{{  .Environment.Values | get (printf "%sVersion" "tpsvc-config") "" | eq "" | ternary "../.." "talend" }}"


and it looks chart: "{{ .Enviro...ersion" "tpsvc-config") "" | eq "" ..... to the yaml parser

) and | eq should look like stray terms to the yaml parser

and probably chart: "{{ .Enviro...ersion" "tpsvc-config" is chart: "str1" "str2" which isn’t valid as well
SeB
SeBover 7 years ago
ha ok.
mumoshu
mumoshuover 7 years ago
my understanding may be incomplete but that’s probably it 🙂

: | should always work
Andrew Nazarov
Andrew Nazarovover 7 years ago
Probably it would be useful to mention this trick somewhere in the docs. It’s not that obvious at first.
Justice London
Justice Londonover 7 years ago
Howdy. Not sure if this question has been asked before... but how do you get selectors when specifying an environment to work? I get an error if I use something like:


helmfiles:
   - path: environments/coreserv/production/helmfile.yaml

---
releases:
  - name: mycoolrelease
    labels:
       team: coreserv

---
`helmfile -e production -l team=coreserv diff`
Justice London
Justice Londonover 7 years ago
If I don't use an environment it is able to find the helmfile releases defined there.
mumoshu
mumoshuover 7 years ago
@Justice London Just replied in the thread
SeB
SeBover 7 years ago(edited)
Hello @mumoshu
Is it on purpose that there is no documentation on the new state value introduced here :
https://github.com/roboll/helmfile/pull/647
Cedric Meury
Cedric Meuryover 7 years ago
Yo fellow Helmfile freaks 😆
mumoshu
mumoshuover 7 years ago
Hey! 👋
timduhenchanter
timduhenchanterover 7 years ago(edited)
Is it possible to get helmfile template to only spit out YAML within the executable? Right now I’m just nuking all the lines before the first --- match but I’m not familiar enough with helmfile yet to know that this will resolve all cases of non-templated output
mumoshu
mumoshuover 7 years ago
Yeah! I thought I've changed all the logs to go stderr and made stdout dedicated to actual template output.
But that's not the case, right? If you could comment on the relevant github issue about redundant lines you saw, it would help me fixing it
Ryan Richards
Ryan Richardsover 7 years ago
Really like the content you guys publish. Also am enjoying helmfile.
Ryan Richards
Ryan Richardsover 7 years ago
Im using terraform to build the cluster and would like to use helmfile for configuring all the post-installation tasks.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
if only we had a terraform-helmfile-provider 😃
Alexis
Alexisover 7 years ago
hey guys, just want to know if it's possible to use reuse-values in helmfile?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
helmfile supports YAML anchors
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
might that help?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
we also use environment variables to do this
mumoshu
mumoshuover 7 years ago
And helmfile has never intended to support helm’s --reuset-values because it defeats the one of purposes of helmfile - reproducible deployments!
But I may be missing something - what’s your goal for --reuset-values @Alexis?
mumoshu
mumoshuover 7 years ago
We now have a Kubernetes operator for helmfile

https://github.com/roboll/helmfile/issues/153
https://github.com/mumoshu/helmfile-operator

I’m trying to build something that complements weaveworks/flux, argo-cd, brigadecore/brigade…
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Amazing!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
excited to take a look
mumoshu
mumoshuover 7 years ago
Ask me anything! I’m not yet sure how to best describe it myself
mumoshu
mumoshuover 7 years ago
one of limitations of flux, argo-cd is that it’s inability to run helmfile apply on git commit.. it works by sourcing k8s manfiests generated by helmfile template(both of em allows you to run helmfile template automatically on git commit btw)
mumoshu
mumoshuover 7 years ago
normally it makes many useful helm commands unusable. helm test, helm status, helm list, and so on.
mumoshu
mumoshuover 7 years ago(edited)
with helmfile-operator you can manage Helmfile custom resources in git, so that argo-cd or flux can reconcile helmfile crs on git commit, and then the operator runs helmfile commands
mumoshu
mumoshuover 7 years ago
brigade is basically a ci/cd system that takes JavaScript code as a pipeline definition. so just run helmfile apply from js that is triggered via git commit
mumoshu
mumoshuover 7 years ago
or create Helmfile custom resources from the pipeline and the rest is the same as argo-cd and flux.
Andrew Nazarov
Andrew Nazarovover 7 years ago
Man, I’ve been waiting for something like helmfile operator. Even thought about trying to write it by myself, but 🍾🍾 - it’s here. I’ll definitely take a look.
Andrew Nazarov
Andrew Nazarovover 7 years ago
Really great news!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
how are errors handled? e.g. a bad helmfile rollout?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
i imagine helmfile diff is not really suitable for this workflow?
Andrew Nazarov
Andrew Nazarovover 7 years ago
What I find tricky in Argo and Flux is how they handle multi-cluster setup. I think it should be easier to do with helmfile-operator.
mumoshu
mumoshuover 7 years ago
// Just recalled that I was in the process of renaming the project from appliance-operator to helmfile-operator.. Hold on
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
aha, that is more clear to me
Erik Forsberg
Erik Forsbergover 7 years ago
Is there any variable I can use from within a hook to anchor my paths to the directory of the helmfile?

The use case is that I'm modifying a namespace via an kubectl apply -f <file>, and right now I must be in the same directory as the helmfile, i.e I can't use --file to point at the helmfile, or the <file> won't be found. So if there is a variable, and hook arguments are templated, then.. I could.
Sean Turner
Sean Turnerover 7 years ago(edited)
Does helmfile ever get locked out? I've been trying to install a couple of deploys, a service, ingress, service-account, cluster-role-binding, and configmap, and I started getting the following error (after many helmfile applys). However, I switched clusters, and stopped getting the error...

$ helmfile apply --args "--dry-run"
Building dependency ../my-appV2
No requirements found in ../my-appV2/charts.

Building dependency ../my-appV2
No requirements found in ../my-appV2/charts.

Building dependency ../my-appV2
No requirements found in ../my-appV2/charts.

Building dependency ../my-appV2
No requirements found in ../my-appV2/charts.

Building dependency ../my-appV2
No requirements found in ../my-appV2/charts.

Building dependency ../my-appV2
No requirements found in ../my-appV2/charts.

Building dependency ../my-appV2
No requirements found in ../my-appV2/charts.

Comparing sean-configmap ../my-appV2
Comparing sean-deploy-green ../my-appV2
Comparing sean-service-account ../my-appV2
Comparing sean-ingress ../my-appV2
Comparing sean-service ../my-appV2
Comparing sean-deploy-blue ../my-appV2
Comparing sean-namespace ../my-appV2
in ./helmfile.yaml: 7 errors:
err 0: failed processing release sean-ingress: helm exited with status 1:
  Error: "sean-ingress" has no deployed releases
  Error: plugin "diff" exited with error
err 1: failed processing release sean-service-account: helm exited with status 1:
  Error: "sean-service-account" has no deployed releases
  Error: plugin "diff" exited with error
err 2: failed processing release sean-deploy-blue: helm exited with status 1:
  Error: "sean-deploy-blue" has no deployed releases
  Error: plugin "diff" exited with error
err 3: failed processing release sean-configmap: helm exited with status 1:
  Error: "sean-configmap" has no deployed releases
  Error: plugin "diff" exited with error
err 4: failed processing release sean-service: helm exited with status 1:
  Error: "sean-service" has no deployed releases
  Error: plugin "diff" exited with error
err 5: failed processing release sean-namespace: helm exited with status 1:
  Error: "sean-namespace" has no deployed releases
  Error: plugin "diff" exited with error
err 6: failed processing release sean-deploy-green: helm exited with status 1:
  Error: "sean-deploy-green" has no deployed releases
  Error: plugin "diff" exited with error
jqjq
jqjqover 7 years ago
Is there a way to run a custom script everytime a helmfile command is run? One usecase is that when I run a helmfile -e ENV … I want to run a script to check my KUBECONFIG is pointing to the right cluster for the environment. I can do it as a release hook, but the release hook declaration has to be duplicated for every release. It’d be nice if I can define a hook globally.
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
hi @mumoshu can I add repositories.yaml file to bases? it contains repositories spec
mumoshu
mumoshuover 7 years ago
yeah it should work
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
add repositories causes error
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago(edited)
err: no releases found that matches specified selector() and environment(local), in any helmfile
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
my bases:


bases:
  - ./base/repositories.yaml
  - ./base/environments.yaml
mumoshu
mumoshuover 7 years ago
could you try moving base dir out of helmfile.d?
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
yes, I have tried that too
mumoshu
mumoshuover 7 years ago
hmm, could you add --log-level=debug like helmfile --log-level=debug to hopefully see at which point helmfile is failing?
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago

processing file "0-system-service.yaml" in directory "helmfile.d"
changing working directory to "/home/hh/deployments/helmfile.d"
first-pass rendering starting for "0-system-service.yaml.part.0": inherited=&{local map[] map[]}, overrode=<nil>first-pass uses: &{local map[] map[]}
error in first-pass rendering: result of "0-system-service.yaml.part.0":
 0: #
 1:
 2: bases:
 3:   # - ./base/environments.yaml
 4:   - ./base/repositories.yaml
 5:   - ./base/environments.yaml
 6:
 7:
 8: releases:
 9:   - name: sb-redis
10:     chart: stable/redis
11:     labels:
12:       test: true
13:

first-pass produced: &{local map[] map[]}
first-pass rendering result of "0-system-service.yaml.part.0": {local map[] map[]}
second-pass rendering result of "0-system-service.yaml.part.0":
 0: #
 1:
 2: bases:
 3:   # - ./base/environments.yaml
 4:   - ./base/repositories.yaml
 5:   - ./base/environments.yaml
 6:
 7:
 8: releases:
 9:   - name: sb-redis
10:     chart: stable/redis
11:     labels:
12:       test: true
13:

first-pass rendering starting for "base/repositories.yaml.part.0": inherited=&{local map[] map[]}, overrode=<nil>
first-pass uses: &{local map[] map[]}
first-pass produced: &{local map[] map[]}
first-pass rendering result of "base/repositories.yaml.part.0": {local map[] map[]}
vals:
map[]
defaultVals:[]
second-pass rendering result of "base/repositories.yaml.part.0":
 0: repositories:
 1:   - name: stable
 2:     url: <https://kubernetes-charts.storage.googleapis.com/>
 3:   - name: incubator
 4:     url: <https://kubernetes-charts-incubator.storage.googleapis.com/>

changing working directory back to "/home/hh/deployments"
err: no releases found that matches specified selector() and environment(local), in any helmfile
mumoshu
mumoshuover 7 years ago
so you seem to still have base under helmfile.d
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
oh yes I forgot to move, but when I move I still have the error
mumoshu
mumoshuover 7 years ago(edited)
if you move it out of helmfile.d do you see another errors?
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
hold on
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
still error
mumoshu
mumoshuover 7 years ago
which error do you see?
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
my bases:

bases:
  - ../common/base/repositories.yaml
  - ../common/base/environments.yaml
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
but if I remove repositories line, it works
mumoshu
mumoshuover 7 years ago
mind sharing your logs with --log-level=debug once again?
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago

processing file "0-system-service.yaml" in directory "helmfile.d"
changing working directory to "/home/hh/test/deployments/helmfile.d"
first-pass rendering starting for "0-system-service.yaml.part.0": inherited=&{local map[] map[]}, overrode=<nil>first-pass uses: &{local map[] map[]}
error in first-pass rendering: result of "0-system-service.yaml.part.0":
 0: #
 1:
 2: bases:
 3:   # - ./base/environments.yaml
 4:   - ../common/base/repositories.yaml
 5:   - ../common/base/environments.yaml
 6:
 7:
 8: releases:
 9:   - name: sb-redis
10:     chart: stable/redis
11:     labels:
12:       test: true
13:

first-pass produced: &{local map[] map[]}
first-pass rendering result of "0-system-service.yaml.part.0": {local map[] map[]}
second-pass rendering result of "0-system-service.yaml.part.0":
 0: #
 1:
 2: bases:
 3:   # - ./base/environments.yaml
 4:   - ../common/base/repositories.yaml
 5:   - ../common/base/environments.yaml
 6:
 7:
 8: releases:
 9:   - name: sb-redis
10:     chart: stable/redis
11:     labels:
12:       test: true
13:

first-pass rendering starting for "../common/base/repositories.yaml.part.0": inherited=&{local map[] map[]}, overrode=<nil>
first-pass uses: &{local map[] map[]}
first-pass produced: &{local map[] map[]}
first-pass rendering result of "../common/base/repositories.yaml.part.0": {local map[] map[]}
vals:
map[]
defaultVals:[]
second-pass rendering result of "../common/base/repositories.yaml.part.0":
 0: repositories:
 1:   - name: stable
 2:     url: <https://kubernetes-charts.storage.googleapis.com/>
 3:   - name: incubator
 4:     url: <https://kubernetes-charts-incubator.storage.googleapis.com/>

changing working directory back to "/home/hh/test/deployments"
err: no releases found that matches specified selector() and environment(local), in any helmfile
mumoshu
mumoshuover 7 years ago
@Ribhararnus Pracutiar Thanks!

Would you mind sharing --log-level=debug logs with (1) - ./base/repositories.yaml commented out and (2) - ./base/repositories.yaml moved after ../common/base/environments.yaml as well?
Probably I can get what’s wrong with the info
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
I remove ./base/repositories, and move ../common/base/repositories under environments:


$ helmfile --environment local --log-level=debug lint
processing file "0-system-service.yaml" in directory "helmfile.d"
changing working directory to "/home/hh/test/deployments/helmfile.d"
first-pass rendering starting for "0-system-service.yaml.part.0": inherited=&{local map[] map[]}, overrode=<nil>first-pass uses: &{local map[] map[]}
error in first-pass rendering: result of "0-system-service.yaml.part.0":
 0:
 1:
 2: bases:
 3:   - ../common/base/environments.yaml
 4:   - ../common/base/repositories.yaml
 5:
 6:
 7: releases:
 8:   - name: sb-redis
 9:     chart: stable/redis
10:     labels:
11:       test: true
12:

first-pass produced: &{local map[] map[]}
first-pass rendering result of "0-system-service.yaml.part.0": {local map[] map[]}
second-pass rendering result of "0-system-service.yaml.part.0":
 0:
 1:
 2: bases:
 3:   - ../common/base/environments.yaml
 4:   - ../common/base/repositories.yaml
 5:
 6:
 7: releases:
 8:   - name: sb-redis
 9:     chart: stable/redis
10:     labels:
11:       test: true
12:

first-pass rendering starting for "../common/base/environments.yaml.part.0": inherited=&{local map[] map[]}, overrode=<nil>
first-pass uses: &{local map[] map[]}
envvals_loader: loaded ../common/environments/local.yaml:map[test:true]
first-pass produced: &{local map[test:true] map[]}
first-pass rendering result of "../common/base/environments.yaml.part.0": {local map[test:true] map[]}
vals:
map[test:true]
defaultVals:[]
second-pass rendering result of "../common/base/environments.yaml.part.0":
 0: environments:
 1:   local:
 2:     values:
 3:       - ../common/environments/local.yaml
 4:   development:
 5:     values:
 6:       - ../common/environments/development.yaml
 7:   staging:
 8:     values:
 9:       - ../common/environments/staging.yaml
10:   production:
11:     values:
12:       - ../common/environments/production.yaml

envvals_loader: loaded ../common/environments/local.yaml:map[test:true]
merged environment: &{local map[test:true] map[]}
first-pass rendering starting for "../common/base/repositories.yaml.part.0": inherited=&{local map[] map[]}, overrode=<nil>
first-pass uses: &{local map[] map[]}
first-pass produced: &{local map[] map[]}
first-pass rendering result of "../common/base/repositories.yaml.part.0": {local map[] map[]}
vals:
map[]
defaultVals:[]
second-pass rendering result of "../common/base/repositories.yaml.part.0":
 0: repositories:
 1:   - name: stable
 2:     url: <https://kubernetes-charts.storage.googleapis.com/>
 3:   - name: incubator
 4:     url: <https://kubernetes-charts-incubator.storage.googleapis.com/>

changing working directory back to "/home/hh/test/deployments"
err: no releases found that matches specified selector() and environment(local), in any helmfile
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago(edited)
actually my original helmfile is complicated and debugging for hours, I don't know what's happening, until I am surprised that the repositories base part causes the error a while ago
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
anyway, Thank you very much for your support @mumoshu
mumoshu
mumoshuover 7 years ago(edited)
@Ribhararnus Pracutiar according to the logs your issue isn’t resolved yet, right? I’ll take a look and try to see what can go wrong tonight 🙂 thanks for reporting!
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago(edited)
No worries buddy. Right still not resolved, maybe I wanna use repositories in every file, violate DRY till the issue resolved 😁
Erik Forsberg
Erik Forsbergover 7 years ago
Hmm.. Does a non-default environment inherit values from the default environment? I.e, values not defined under "production", will they inherit value defined under "default"?
SeB
SeBover 7 years ago
@mumoshu just to let you know I had a good time contributing to the helmfile project but I will certainly not contribute anymore. We have decided to leverage the ansible scripts we are using for production deployment also for the developer workflow. I believe it is too big a machinery compared to helmfile but this is a pragmatical decision for now to not multiply our tools.
SeB
SeBover 7 years ago
This project is awesome and will keep an eye on it.
Erik Forsberg
Erik Forsbergover 7 years ago
How do I make helmfile stop if there's trouble with one of the charts? I.e, I don't want it to continue setting up chart B if chart A had any kind of trouble. Is that the wait parameter? I'm already running with concurrency 1 since I use tillerless.
Nelson Jeppesen
Nelson Jeppesenover 7 years ago(edited)
I'm confused to to best use readFile with .gotmpl when pulling in a non-yaml file

I have this in a values .gotmpl file, and it works

extraConfigMaps:
  output.conf: |-
    <match **>
      @id elasticsearch
      @type elasticsearch
...


I'd like to use this, so I can pull out that large xml into it's own file fluentd-elasticsearch.xml
extraConfigMaps:
    output.conf: |-
    {{ readFile "fluentd-elasticsearch.xml" | indent 2 }}


but I keep getting error converting YAML to JSON: yaml: line 35: could not find expected ':'
mumoshu
mumoshuover 7 years ago
Hey! Try this:


extraConfigMaps:
    output.conf: |-
{{ readFile "fluentd-elasticsearch.xml" | indent 6 }}
mumoshu
mumoshuover 7 years ago(edited)
not sure why you have 4 spaces before output.conf but you can also try:


extraConfigMaps:
  output.conf: |-
{{ readFile "fluentd-elasticsearch.xml" | indent 4 }}
mumoshu
mumoshuover 7 years ago(edited)

extraConfigMaps:
    output.conf: |-
    {{ readFile "fluentd-elasticsearch.xml" | indent 2 }}


this won’t work cuz we get


extraConfigMaps:
  output.conf: |-
    <match **>
  @id elasticsearch
  @type elasticsearch
...
Nelson Jeppesen
Nelson Jeppesenover 7 years ago
@mumoshu omg thang you - I feel very dumb, but that was it 🙂
Nelson Jeppesen
Nelson Jeppesenover 7 years ago
🎆
Pierre Humberdroz
Pierre Humberdrozover 7 years ago
Can I update the requirment version of a helm chart that I am using ?
So in this case I am using stable/prometheus-operator and would like to update the grafana version to 3.5 instead of 3.3
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
hi @mumoshu is yesterday issue not resolved yet?
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
anyway, I want to ask question here regarding multi-line string
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
local.yaml:


config: |
  test: a
  yes: true


in helmfile chart, template/configmap.yaml

default.yaml: |
  {{ tpl .Values.config . }}
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
but after deployment, or sync, I only have

default.yaml:
  test: a


not including yes: true
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
is it true?
mumoshu
mumoshuover 7 years ago
@Ribhararnus Pracutiar Regarding the issue you had yesterday, yeah, I think I got it.

Try adding the below to repositories.yaml:


environments:
  local: {}
  development: {}
  staging: {}
  production: {}
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
ok thanks, maybe later I comeback with the issue, as for now, I use repositories in every single helmfile
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
what about above issue?
Ribhararnus Pracutiar
Ribhararnus Pracutiarover 7 years ago
ah Im sorry, you replied on my message, wait
Nelson Jeppesen
Nelson Jeppesenover 7 years ago(edited)
What's the appropriate way to run a post deploy task?

I'm spinning up an elasticsearch cluster, but after i do I want helm to run a few curl commands. I'm thinking about creating a chart with a cronjob,but is there a better way?

I know about post hooks, but that runs locally where the helmfile is run, right? Id rather run this once in a pod on the k8s cluster.
Erik Forsberg
Erik Forsbergover 7 years ago
Can I access the name of the current release in some variable, inside a values template file?
Erik Forsberg
Erik Forsbergover 7 years ago
I.e, I have two nginx-ingress releases, ingress-test and ingress-production, and I want to set antiaffinity based on the release name, from a values template.
Ryan Richards
Ryan Richardsover 7 years ago
What is the recommended approach for converting a standard helm chart into a helmfile? if there is documentation on this i apologize.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@Ryan Richards is there a helm chart in particular? we might have an example of it.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
Andrew Nazarov
Andrew Nazarovover 7 years ago
I wouldn’t call it a conversion, wrapping maybe 😉 But it doesn’t really matter. Yes, cloudposse has a lot of great examples. Thank you for this, btw!
Ryan Richards
Ryan Richardsover 7 years ago
If you wanted to run a simple script that, lets say creates a few namespaces, could you do this somewhere with helmfiles? I found that working with terraform null resource didn't work as i expected. If there is a best-practice for running these kind of configuration processes i would love to hear about it 🙂
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Helm will by default create the namespace for you. No need to do anything fancy.
Ryan Richards
Ryan Richardsover 7 years ago
@Erik Osterman (Cloud Posse) thanks, i was using that as an example. We have several post-setup configuration steps that need to occur once our terraform is finished with the basic cluster setup in gke. These include things like setting default limits.
Ryan Richards
Ryan Richardsover 7 years ago
Most of these tasks are installing prometheus, grafana etc. Im working now to create helmfiles for these but there are a few that to be repeatable would need to be run as scripts or something
Ryan Richards
Ryan Richardsover 7 years ago
hopefully my statement made sense 🙂 Im simply trying to find the best manner to apply configuration changes that dont involve installing or deploying. Running gcloud commands to obtain connectivity to a specific cluster would be another example.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
you can trigger commands as part of hooks
Ryan Richards
Ryan Richardsover 7 years ago
@Erik Osterman (Cloud Posse) awesome! thank you!
Ryan Richards
Ryan Richardsover 7 years ago
ah hooks on helmfile - i gotcha
Vadim
Vadimover 7 years ago
Hi, could someone help me with the issue? https://github.com/roboll/helmfile/issues/731
Vadim
Vadimover 7 years ago
It should not take much time to help me coz solutions seems to be simple
Vadim
Vadimover 7 years ago
But problem is strange and unexpected ... and solution not obvious for me