#helmfile - January 2019

January 2019
Dave Yu
Dave Yualmost 8 years ago
@Dave Yu has joined the channel
Dave Yu
Dave Yualmost 8 years ago
I’m trying to set container args so the spec in the deployment manifest looks like this:

    spec:
      containers:
      - args:
        - -endpoint
        - $(ES_ENDPOINT)

However, when using the monochart and specifying like this:

        deployment:
          pod:
            args:
              - -endpoint
              - $(ES_ENDPOINT)

This is the manifest that gets generated:

    spec:
      containers:
      - args:
        - -endpoint $(ES_ENDPOINT)

Any ideas?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
I think there was a recent bug with this
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
@Andriy Knysh (Cloud Posse) was that fixed?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
@Igor Rodionov ☝️
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
(btw, a bunch of open PRs against monochart https://github.com/cloudposse/charts/pulls)
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
hmm… i did not see those issues, maybe from some recent additions
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
looks like we only support args as a string
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
are you running the latest release?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
0.9.0
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
we always supported args as strings, but after the latest addition from @Igor Rodionov I think it could be yaml now https://github.com/cloudposse/charts/blob/master/incubator/monochart/templates/deployment.yaml#L56
Dave Yu
Dave Yualmost 8 years ago
this is with 0.8.0
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
update to 0.9.0 and test with yaml
Dave Yu
Dave Yualmost 8 years ago
will do. thanks
Dave Yu
Dave Yualmost 8 years ago
so.. i can’t figure out how it should be as yaml
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
sec
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
My guess is this should look something like
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago(edited)

args:
{{ toYaml .Values.deployment.pod.args | indent 10 }}
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
basically, put it on a new line
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Use any guy repo with Helmfile https://github.com/aslafy-z/helm-git
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
@Igor Rodionov ☝️
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
@Daren
Daren
Darenalmost 8 years ago
Nice, looks like a better implementation.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
yea, uses git protocol scheme so it’s compatible with all helm tools
mumoshu
mumoshualmost 8 years ago
Yep helm-git seems GREAT. I’m even considering to include it in helmfile’s docker image https://github.com/roboll/helmfile/issues/436
mumoshu
mumoshualmost 8 years ago
How about adding a “mixins” to helmfile? I need your feedback(s)!
https://github.com/roboll/helmfile/issues/428#issuecomment-455055033
mumoshu
mumoshualmost 8 years ago
And also a gomplate integration for sourcing helm chart values from vault (and more in the future
https://github.com/roboll/helmfile/issues/392#issuecomment-455061273
mumoshu
mumoshualmost 8 years ago
Have you ever wanted to write {{ readFile "whatever" | tpl . }} in your helmfile templates?
https://github.com/roboll/helmfile/issues/420
zadkiel
zadkielalmost 8 years ago
@zadkiel has joined the channel
zadkiel
zadkielalmost 8 years ago(edited)
Hi guys, i'm struguling trying to make helmfile (helm diff) work with my git plugin
zadkiel
zadkielalmost 8 years ago
it looks like the HELM_HOME isn't set and as the plugin uses helm cmd it fails
zadkiel
zadkielalmost 8 years ago(edited)

Error: Couldn't load repositories file (repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)
Error: found in requirements.yaml, but missing in charts/ directory: webhook

within my git downloader plugin called by helm diff
zadkiel
zadkielalmost 8 years ago(edited)
I fixed it by setting up a temporary helm home in a temp file:

  HELM_HOME=$(mktemp -d)
  trap 'rm -rf "$HELM_HOME"' EXIT
  helm init --client-only --home "$HELM_HOME" 
  export HELM_HOME

Still, I can't access to the existing repositories.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
What is the error you are getting now?
zadkiel
zadkielalmost 8 years ago
No more error now, but the plugins resolves dependencies for plugin (with helm dependency update) without using the existing user repositories as I had to setup a temporary helm home
zadkiel
zadkielalmost 8 years ago
Now I hit something else,

    hooks:
    - events: ['prepare']
      command: 'kubectl'
      args: ['{{if eq .HelmfileCommand "delete"}}delete{{else}}apply{{end}}', '-f', '<https://gist.githubusercontent.com/aslafy-z/8725d10394b6f434ce0da65accfc994b/raw/fb32e659e97da5bd9a8a91dcd7e0de6d2a891b81/cert-manager-0.5.2-crd.yaml>']

gives me

error during helmfile.yaml parsing: template: stringTemplate:27:22: executing "stringTemplate" at <.HelmfileCommand>: can't evaluate field HelmfileCommand in type tmpl.TemplateData
zadkiel
zadkielalmost 8 years ago
There should be at least one more hook who triggers on a release delete
zadkiel
zadkielalmost 8 years ago
I should be able to use this kind of templating right?
zadkiel
zadkielalmost 8 years ago
@Erik Osterman (Cloud Posse) any clue?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
(we are not using hooks yet…)
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
but i like what you’re trying to do
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
we could use that too…e.g. with kiam to annotate a namespce
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
@Igor Rodionov ☝️
Igor Rodionov
Igor Rodionovalmost 8 years ago
I saw helmfile hooks just today
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
@zadkiel rather than use kubectl, have you considered using the raw chart?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
We can deploy nearly any service without writing a helm chart
zadkiel
zadkielalmost 8 years ago
Waw that's cool!
Fits perfectly helmfile

Wouldn't it be somewhat bloated to use a full chart just to deploy a crd?
Should I add the base chart (cert-manager) and his crd as realease in a single helmfile? And then depend on this helmfile within another one?

Any idea why the templating line I send doesn't work?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago

Wouldn’t it be somewhat bloated to use a full chart just to deploy a crd?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
my preference is consistency
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
with helm, we get a history of releases/changes
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago(edited)
we treat it like an OS package manager
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago(edited)
prefer apk add something over tar -zvxf something.tar.gz && make -C something all install so to say 😃
zadkiel
zadkielalmost 8 years ago
Sure, will try it! Still, any idea about the templating issue ? :/
mumoshu
mumoshualmost 8 years ago(edited)
@zadkiel Hey! I guess you need to defer template execution.

Raw template exprs like {{ .Foo.Bar }} are executed at parsing helmfile.yaml. What you need there is defer the execution of {{ .Helmfile.Command ... }} until each release is processed(which is where the hook happens).

Try using golang template comments for that.

More concretely,


{{if eq .HelmfileCommand "delete"}}delete{{else}}apply{{end}}



should be rewritte to:


"{{`{{if eq .HelmfileCommand "delete"}}delete{{else}}apply{{end}}`}}"
mumoshu
mumoshualmost 8 years ago
Gathering feedbacks on helmfile values https://github.com/roboll/helmfile/issues/430
mumoshu
mumoshualmost 8 years ago
And the upcoming Release Template feature https://github.com/roboll/helmfile/pull/439
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago(edited)
@Igor Rodionov any opinions? ☝️
zadkiel
zadkielalmost 8 years ago(edited)
Hi guys! I finished helm-git refactor to make it more modulable and robust. It's still pending as a PR, feel free to give an eye and throw your opinion / review: https://github.com/aslafy-z/helm-git/pull/1. Thanks!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Added a comment
mumoshu
mumoshualmost 8 years ago
Awesome work! Just added comments as well.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Thanks @mumoshu - good point
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
@Igor Rodionov @joshmyers @Andriy Knysh (Cloud Posse) ☝️
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
layering is supported
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
super!
zadkiel
zadkielalmost 8 years ago
Still working on helm-git , switching from '@' to '//' broke helm fetch repo/chart calls. Had to revert 😕
zadkiel
zadkielalmost 8 years ago(edited)
I'm still blocked to deploy cert-manager. I need to deploy it's CRDs before deploying it, and apply configured CRDs resources after all.
zadkiel
zadkielalmost 8 years ago
One way simple to do that would be to accept concurrency field within helmfile.yaml so I could have a helmfile dedicated to cert-manager and apply my resources one by one
zadkiel
zadkielalmost 8 years ago
I'm looking for a tool that takes a yaml k8s resources file and convert it into a compatible value file for incubator/raw. Any idea?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Haven’t seen a tool for that
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
However, have you seen yq?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Since you're a total scripting ninja, you could probably munge the YAML with this tool
mumoshu
mumoshualmost 8 years ago
anyone uses requirements.yaml and requirements.lock with helmfile? welcoming your opinion on https://github.com/roboll/helmfile/issues/415#issuecomment-457097079
mumoshu
mumoshualmost 8 years ago
interested in adding a helm-tiller integration to helmfile? come to leave your comment! https://github.com/roboll/helmfile/issues/449
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Ohhhhh that’s a neat idea!
Corey Gale
Corey Galealmost 8 years ago
@Corey Gale has joined the channel
aqua
aquaalmost 8 years ago
@aqua has joined the channel
Shane
Shanealmost 8 years ago
I'm overdue on a PR to helmfile - https://github.com/roboll/helmfile/pull/459
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Thanks @Shane
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
We've wanted to do this. As a stop-gap, we're using a namespace label in all of our releases.