#helmfile (2020-08)
Questions and discussion around helmfile https://github.com/roboll/helmfile and https://github.com/cloudposse/helmfiles
Archive: https://archive.sweetops.com/helmfile/
2020-08-01
@mumoshu Not sure if this is a usual/tipical scenario but i started using helmfile in my CI/CD pipeline and one requirement I have is after the deployment is succesful (this can be confirmed with the wait parameter) I need to execute a manual command inside the deployed pod. For this I use the helmfile list with labels in order to identify the helm release name and then get the pod from the release name. Not sure if there’s a better way to do this? I parse the output of helme list with json (which is why I also got an issue opened here https://github.com/roboll/helmfile/issues/1270)
When doing a helmfile list –output=json the labels presented in the output are of csv format. I do a lot of jq parsing to get meaningful information from the releases for other external scripts an…
You could use a job with post-install helm hook
When doing a helmfile list –output=json the labels presented in the output are of csv format. I do a lot of jq parsing to get meaningful information from the releases for other external scripts an…
That post-install trigger only if the deployment is succesfull?
How would I target the job strictly at the container from the deployment?
I will run in another container inside your pod
it’s always a bad pattern to run a command inside a running container
Agreed but in this case i need to execute a binary inside the container
you can run a job with exact same image I guess https://helm.sh/docs/topics/charts_hooks/
Describes how to work with chart hooks.
if it runs in same pod, it will have same environment
you use this in pre-install
I remember going this route and having a problem but i will take a look once again and see what comes up
for our staging, it deploys database, kafka schema, etc, and after, helm deploys ours pods
Ah I remember one thing is to see the log output in the ci/cd pipeline and also have it fail if there’s an error
about what?
I think postinstall
should be what you want. It’s called only after successful install.
In the hook command, perhaps using
kubectl get po -l release={{` {{.Release.Name}} `}}
and then kubectl exec
on the pod would work?
postsync
is called after install/upgrade regardless of success/failure, and you should be able to check {{.Error}}
for emptiness to determine if it was successful or not. try that instead of postinstall you need testing after upgrade, too.
@mumoshu postinstall are run locally? I thought hook was only for resource creations like jobs
hooks can be any local processes. you’ll usually use preopare
and cleanup
hooks for creating/deleting charts and presync
for creating resources not managed by required by release
for postsync
… im not sure. i thought i heard anyone used it for notification
and postinstall
is a specialization of postsync
Maybe I’m going about it the wrong way or something
2020-08-02
2020-08-03
Does anyone use helm3 in CI/CD ( maybe inside helmfile too)? How do you deal with missing real --force
in helm3 compared to helm2? It looks like https://github.com/helm/helm/pull/7431 isn’t going to be merged to add real force to helm3.
An additional optional flag –recreate can be passed on upgrade (or rollback) of a release. In combination with the –force flag the following strategies are employed when updating a resource (whic…
you can put these specific resources in hooks, see https://github.com/kubernetes/kubernetes/issues/45398#issuecomment-478619253 for an example
PodDisruptionBudget is immutable at this moment. It would be a nice improvement to allow changes to it, at the least to the minAvailable field. Not sure whether this counts as a bug or a feature re…
Are you talking about delete&recreate on every helm upgrade
, including cases when immutable resource isn’t changed ?
yes. well of course it may or may not apply to your use-cases, depending on which resources you need to “force update”. In our case for example, we used to do it on PDB, and now we’re doing it on Jobs, so deleting and recreating is not an issue
but I agree that it’s a pain
I hit this with Service and StatefulSet
which part of the spec ?
I use the following to install / upgrade a chart: ./helm upgrade –install –set rbac.create=false –set controller.replicaCount=2 –set controller.service.loadBalancerIP=$ip –wait main-ingress st…
do helm hooks require to add on-the-fly helmfile json patches to stock charts to apply hooks to these charts?
ah yes, the volumeClaimTemplates
in the statefulset, we had this issue too…
hopefully the pvc size won’t change often, you can do a 1-time operation (backup, delete, recreate, restore data)
PVC isn’t affected during statefulset recreation
so backup+restore isn’t required
about json patches, that depends on the charts, if they support adding annotations or not
and it’s still a semi-solution just to emulate helm2 behaviour with drawbacks like recreating the resource every time
I have helmfile apply
over 50 releases in a dev CI/CD pipeline, and it works fine, but it’s helm2, not 3.
We are dealing with this manually. I.e. we do helm delete
and then trigger pipelines with helmfile and stuff. Not an ideal solution for sure.
yes, donwtime and side effects are everywhere
Hi Everyone,
i have come across a interesting requirement in my helm charts
kind: Deployment
spec:
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
in this config , i need to change the configmap.yaml name dynamically w.r.t environment Like this one checksum/config: {{ include (print $.Template.BasePath “/configmap-{{ .Release.Name }}.yaml”) . | sha256sum }}
OR checksum/config: {{ include (print $.Template.BasePath “/configmap-{{ .Values.env }}.yaml”) . | sha256sum }}
Do you wanna mix helm gotmpl with helmfile gotmpl in the same line ?
Does anyone have come across this situation ?
unfortunately, none of these will work
2020-08-04
Hi, I have a remote chart including somes yaml value files (i.e values-dev.yaml) I thought I would have been able to do that:
releases:
- name: xxx
chart: helm-private-repo/foo
values:
- values-dev.yaml
But I have the following response:
in ./helmfile.yaml: failed processing release xxx: values file matching "values-dev.yaml" does not exist in "."
It is working when the chart is local but not working when the chart is remote. Is there a way to tell helmfile to use values-dev.yaml from the downloaded chart instead of trying to find values-dev.yaml in ‘.’ ?
So, you wanna pull values from remote instead of local ?
well, values are already in the chart. I was hoping that I could just reference the file I want to use
I know I can put an URL to retrieve values but its a real shame since everything is already included in the chart
helmfile doesn’t have access to the chart, it just calls helm
Ok, and helm is not able to use values from a remote chart then? the file must be present when we run helm -f xxx ?
you need to get values into helmfile, thus shell script(helm3 show values?) or remote yaml file in helmfile is your option.
ok Thanks for confirming. Shame this is not possible straight away
I don’t think that keeping unused values file in the chart is a common practice.
Ok. So It maybe make sense to move values-XXX.yml along with helmfile instead of keeping it in the chart
this looks a common practice. Keep charts and settings separated. You hit some sensitive data in settings usually and you cannot store it in the chart anyway.
Ok Thanks for the advice. I saw couple of charts storing values-XXX.yaml in their repo, but not that many. I will keep them separated.
storing values-XXX.yaml in their repo
I suppose it was a git repo, not a helm repo with charts archives.
Its a git repo, but its in the chart archive. Example: https://github.com/bitnami/charts/tree/master/bitnami/rabbitmq
NOTE: The default values file included inside of a chart must be named values.yaml.
yes for this case this is clear. I just would have liked a comment on the helm website that we can’t specify custom value file even if its included in the chart
Create a PR
Yes
otherwise, would the following work ? I haven’t tried it yet: https://github.com/zendesk/helm-secrets/issues/61#issuecomment-429053736 Its pulling the chart locally through hooks
yep, this should be fine except it will trigger on every helmfile
2020-08-05
I’m trying to get some secrets from gcp secret manager into a string, but I’m having some issues. What I have is a reference to a secret in my common/dev.yaml
file like so:
key1:
user: "<ref+gcpsecrets://projectname/secret-name?version=latest#/path/to/user>"
password: "<ref+gcpsecrets://projectname/secret-name?version=latest#/path/to/password>"
The issue is that when I try to use the value of the secrets in a values.gotmpl file like so: string: "{{ .Values.key1.user }}:{{ .Value.key1.password}}"
I get the actual string "<ref+gcpsecrets://projectname/secret-name?version=latest#/path/to/secret>"
from each value, rather than the value of what the secret reference is. Is there any way to force the reference to be evaluated before being passed along? Or should i structure this some other way? The reason I have it like this is because I need to have the values combined into a string so that the code that is using these values is happy.
did you tried something similar to
string: "{{`{{ .Values.key1.user }}:{{ .Value.key1.password}}`}}"
?
@Jonathan could u try “fetchSecretValue”?
Deploy Kubernetes Helm Charts. Contribute to roboll/helmfile development by creating an account on GitHub.
2020-08-06
Is it possible to deploy a raw kubernetes manifest in helmfile/helm without using kubectl? For example, If i want to deploy a kubernetes ingress only.
I think recently this became supported? something with go-getter
…as chart (#1374) This, in combination with #1172, allows you to use go-getter
-supported URL for K8s manifests on chart
, so that Helmfile automatically fetches it and then turning it into a te…
This, in combination with #1172, allows you to use go-getter-supported URL for K8s manifests on chart, so that Helmfile automatically fetches it and then turn it into a temporary local chart, which…
Do you mean I should be able to deploy like that ?
releases:
- name: ingress
chart: ./raw/ingress-dev.yaml
I have the following error returned:
COMBINED OUTPUT:
Error: only unpacked charts can be updated
there is an example in the pull request
I’ve never used it personally
he targets `
git::<http://github.com/jetstack/cert-manager.git@deploy/crds?ref=v0.15.2>
which is here https://github.com/jetstack/cert-manager/tree/master/deploy/crds (except this is master and not that tag)
Automatically provision and manage TLS certificates in Kubernetes - jetstack/cert-manager
but the tl;dr is that its a repo directory with only a bunch of yaml manifests
Which I believe is what your goal is ?
Oh yes its working if I just pass the folder ./raw instead of ./raw/ingress-dev.yaml
So, I guess in your case if you wanted a single manifest you’d need to do a directory with just that single manifest inside it
In practice do you guys just apply via sync
or apply
with helmfile in your ci/cd ?
helmfile apply with helm2 in dev env
No
Guys? I am getting:
error during gitlab-test2.yaml.part.0 parsing: template: stringTemplate:22:24: executing "stringTemplate" at <.Values.foo.common.kind>: map has no entry for key "foo"
Not sure whats wrong…
environments:
default:
values:
foo:
common:
kind: Secret
repositories:
- name: incubator
url: <https://kubernetes-charts-incubator.storage.googleapis.com>
releases:
- name: test
namespace: test
createNamespace: true
chart: incubator/raw
version: 0.2.3
values:
- resources:
- apiVersion: v1
kind: {{ .Values.foo.common.kind }}
Is it related to https://github.com/roboll/helmfile/issues/932 ?
TL;DR; I want to add a new helmfile.yaml field to make templating helmfile configs easier. Problem Helmfile's double-rendering has opened a wide variety of use-cases that requires you to write …
Works! Thanks I already tried:
environments:
default:
values:
- foo:
common:
kind: Secret
repositories:
- name: incubator
url: <https://kubernetes-charts-incubator.storage.googleapis.com>
releases:
- name: test
namespace: test
createNamespace: true
chart: incubator/raw
version: 0.2.3
values:
- resources:
- apiVersion: v1
kind: "{{ .Values.foo.common.kind }}"
which is not working…
sry this is very confusing indeed, but the root cause here is that environments.NAME.values
needs to be a yaml array, rather than hash
to allow merging multiple values entries
so it should be
environments:
default:
values:
- foo:
common:
kind: Secret
the best practice is to separate environments
and other parts of your helmfile.yaml with ---
like
environments:
default:
values:
foo:
common:
kind: Secret
---
repositories:
- name: incubator
url: <https://kubernetes-charts-incubator.storage.googleapis.com>
releases:
- name: test
namespace: test
createNamespace: true
chart: incubator/raw
version: 0.2.3
values:
- resources:
- apiVersion: v1
kind: {{ .Values.foo.common.kind }}
so you get a much better error
in ./helmfile2.yaml: failed to read helmfile2.yaml: reading document at index 1: yaml: unmarshal errors:
line 4: cannot unmarshal !!map into []interface {}
which tells that you’re mistakenly trying to define values
as map, rather than array([])
Guys? I am trying to add gitlab helm chart repository:
repositories:
- name: custom
url: git+<https://gitlab.com/gitlab-org/charts/gitlab?ref=v4.2.1&sparse=0>
releases:
- name: gitlab
namespace: gitlab
createNamespace: true
chart: custom/gitlab
, but getting:
COMBINED OUTPUT:
Error in plugin 'helm-git': Target file name has to be either 'index.yaml' or a tgz release
Error: looks like "git+<https://gitlab.com/gitlab-org/charts/gitlab?ref=v4.2.1&sparse=0>" is not a valid chart repository or cannot be reached: plugin "helm-git" exited with error
Any idea? Of course that I am aware of official charts ( another thing is that gitlab helm chart is somehow complicated, its using nested subcharts )
Thanks
You can’t use a git repository as source for helm
your repository
must be for helm chart, with a specific index.html for listing available charts, etc
gitlab provides a repo : <https://charts.gitlab.io/>
Cloud Native GitLab Helm Chart
@Issif of course i can https://github.com/aslafy-z/helm-git, point is not to use charts from https://charts.gitlab.io/
Helm plugin to fetch charts from Git repositories. Contribute to aslafy-z/helm-git development by creating an account on GitHub.
Hi, is it really not possible to just specify a plain HTTPS URL for a sub-helmfile like this?
helmfiles:
- path: <https://our-nexus/bla/bla/bla>
- path: git::<ssh://git@>.....
The first URL gives a no matches for path
error message. The second (git::ssh
) works..
I found out that the URL has to be <https://our-nexus/><dir>@<file>
but then helmfile tries to fetch just the directory which leads to a HTTP 404..
<http://example.com/dir@file>
isn’t a http url
True, but it’s what helmfile expects. Otherwise you get an error like this (after digging into the code and fmt.Printing some errors that are otherwise not exposed to the user)
invalid src format: it must be `[<getter>::]<scheme>://<host>/<path/to/dir>@<path/to/file>?key1=val1&key2=val2: got <https://my.ordinary.http.url/dir/file>
So something like <http://example.com/dir/file>
is not even considered by helmfile
It kind of makes sense because helmfile needs the whole directory since the remote helmfile can also reference remote files.
But you cannot “download” a directory over http which makes me think that HTTP ist just not supported at all for remote statefiles?
2020-08-07
@here So we’ve been a helmfile user for many years now. I think there were only a couple dozen stars on the repo when we started, now there are thousands. The project has transformed dramatically during this time and we’ve all benefited immensely from this. I just want to say how grateful I am for everyones help on this, but especially your’s @mumoshu because it would not have been possible without it. I sincerely don’t understand how you can be so productive on all these projects (helmfile, helm-diff, eksctl, brigade, helm, kube-aws, etc) and squash bugs as fast and tirelessly as you do, but you still manage to pull it off. If there ever was such a thing as a 10x engineer, you’re the definition of it. Anyways, we appreciate all the tremendous effort you put forth not just on coding but also on supporting feature requests, answering questions, and just always being so helpful. I regret not stepping up sooner, but just want to share our support and hope others will too! https://github.com/sponsors/mumoshu
Support mumoshu’s open source work
Just a few hours ago I had a conversation with my colleagues and I mentioned @mumoshu in a way that it’s hard to imagine how he does so many things with such a quality and passion. An example for all of us.
Support mumoshu’s open source work
helmfile + variant2 =
I can’t tell you how much I appreciate all your help!
Honestly, I had mixed feelings working on OSS. It’s too tough in regard to how much time and effort I need to put onto it, while I’ve been grateful for having chances of any kinds of collaborations with you all.
Discussing about potential bug, get to distill it into the root cause, finally fixing it together. Receiving feature requests, talking about use-cases, come up with a solution together. Prototyping something and receiving early feedback about it(recent examples would be terraform-provider-helmfile and variant2). I think I love all of those experiences and processes while working on OSS - probably that’s why I’ve been maintaining OSS like Helmfile until now.
Sponsorship - I think this is my first time to receive sponsorships more than one or two at once. Simply I had never realized I would receive such many supports! Combining all my experiences so far, your kind words, and this time, sponsorships, I’m feeling encouraged and motivated more than ever for my work now .
Thank you all for continuing to work with me. Expect me to keep this
// Excuse me for slow response. I had to have some time to organize what I felt
more than 30 likes, but just 8 sponsors on github
2020-08-08
Hello could someone explain how condition
is working, somehow I don’t get it
Hrm.. I’m not familiar with the condition
in helmfile
- we haven’t used it, but my guess is that it works like the installed
flag?
My guess is that borrows from the upstream convention in the Chart.yaml
. See https://helm.sh/docs/topics/charts/#the-chartyaml-file
Explains the chart format, and provides basic guidance for building charts with Helm.
Anyone know the difference between condition
and installed
?
condition
with false
doesn’t delete the release, it’s just ignored, like there is no such release.
installed/installedTemplate
with false
will delete --purge
release.
Taken from state.go
Deploy Kubernetes Helm Charts. Contribute to roboll/helmfile development by creating an account on GitHub.
op | true | false |
--------------------------------------
installed | install | delete --purge |
condition | install | skip/ignore |
kind of
hrm… then how is condition different from enabled
? sounds like condition
is the same as enabled
do we have a keyword enabled
in helmfile?
hah, you know - I must be confused. Doesn’t look like it and then it all makes more sense.
2020-08-10
2020-08-11
Has anyone run into issues before when deploying releases in the same helmfile using needs:
but the latter releases are using a custom resource created by a CRD from the earlier releases?
STDERR:
Error: Failed to render chart: exit status 1: Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Vault" in version "vault.banzaicloud.com/v1alpha1"
Error: plugin "diff" exited with error
Yes. A recently introduced disableValidation flag might help. I’ve just mention this in a different thread:)
the Vault
custom resource is created in the release previous and they are forming a dependency with needs:
2020-08-12
Does anyone else know if its a bug or feature that you can’t do an apply
to a helmfile which contains two releases which have a CRD/CR relationship because of the helm-diff
?
The diff will run on both releases before the apply
and the second release will fail becaues the CR it tries to diff doesn’t exist as a type yet, since its created in the first chart by a CRD
can i use vals for helm repo credentials?
2020-08-13
Eks+helm: I have many applications using helm charts but these charts also have a secrets.yaml. This contains an application.properties
encrypted. I want to remove the username/password from the property file and store it in AWS SSM. This way I would be able to decrypt the property file, have its values in helmfile. After that create a ConfigMap template that gets populated based on the property values from helmfile.
I don’t want to commit the username/password so I would store it in AWS SSM. Though not sure if this is a good idea or how to pass the username/password to the deployment object and not have it in plain text. GoDaddy has this https://ca.godaddy.com/engineering/2019/04/16/kubernetes-external-secrets/ and I wonder if there are any other alternatives. Cheers
Ps. I use helm + helmfile + helm-git
Engineering teams at GoDaddy use Kubernetes with secret management systems, like AWS Secrets Manager.
Helmfile has native support for getting values from SSM as it uses vals (https://github.com/variantdev/vals)
Helm-like configuration values loader with support for various sources - variantdev/vals
Deploy Kubernetes Helm Charts. Contribute to roboll/helmfile development by creating an account on GitHub.
The remote-secrets.md file has some very basic examples, and the vals readme has a section on using SSM to get more info on how to use it
Nice. That simplifies a bunch. Though how do I handle the fact that I need username/password either in application.properties or as env variable. Though I don’t want it in plain text in the pod or in git.
Create a k8s secret using helmfile, and load that secret as environment variables in the pod.
That sounds much easier than I thought. I will try it out. Thank you @bradym
np
Curious. Is it common practice to put password in secrets file not encrypted (just encoded base64)? Even though it retrieves from SSM one could easily get the password from secrets
I have a SSM parameter with the following values:
param1: value1
param2: value2
I use in values.yaml.gotmpl
...
Secrets:
{{ .Environment.Values.someapp | expandSecretRefs | toYaml | nindent 2 }}
in someapp.yaml
...
- releases:
- name: some-app
values:
- ../releases/someapp/values.yaml.gotmpl
- Secrets:
- <ref+awsssm://someapp/testssm?region=us-west-2>
in secrets.yaml
...
data:
{{- range $key, $value := .Values.Secrets}}
{{ $value | b64enc | quote | indent 2 }}
{{- end }}
returns:
...
+ data:
+ 0: "param1: value1\nparam2: value2"
I can’t seem to be able to get the $key= param1 and $value= value1, etc for those variables. The SSM entry gets populated in $value only, $key is always empty.
Alternatively, you can try this option https://thefirstapril.com/2019/06/29/Secret-Management-in-Helm-Kubernetes/ Use helm secrets plugin to encrypt/decrypt the secret file with AWS KMS and pass the encrypted file to helmfile so that all the secret files which are stored in version control system are encrypted #helm secrets enc secrets.yaml releases:
- name: test
namespace: default
version: “0.2.0”
chart: test
set:
- name: “clusterName” value: test secrets:
- secret.yaml
Secret management in HelmHelm is a Kubernetes package manager, Helm helps developer deploy their application to Kubernetes. Helm also provide chart as dependencies for your application at https://hub.
2020-08-14
2020-08-15
just saw that even gitlab is using helmfile => https://gitlab.com/gitlab-com/gl-infra/k8s-workloads/gitlab-com
Kubernetes Workload configurations for GitLab.com This repository is mirrored on https://ops.gitlab.net/gitlab-com/gl-infra/k8s-workloads/gitlab-com
helmfiles for helm releases in gitlab.com infrastructure
They propose some apps in their managed k8s clusters and for installing them they use helm right. A apps I develop will be added in a next release and that’s why I added it on helm hub last week
I am just positively surprised by their adoption. What app did you work on ?
A simple daemon to help you with falco’s outputs. Contribute to falcosecurity/falcosidekick development by creating an account on GitHub.
falco has been integrated by gitlab in 13.2
oh that is nice! But what I mean is they are using helmfile to setup their own infrastructure (what runs gitlab.com) as well now..
Oh I get your point now, great
@Pierre Humberdroz Good find , But I am just wondering why are you positively surprised? I mean is this something that you expect they could have rolled their own solution with helm ? we primarily use gitlab.com for everything we do with our customers and are heavy consumers of pretty much all the solutions they offer.
No but a lot of people I talk to are not even aware that helmfile exists. And seeing some bigger company adopting it makes me happy! I also wanted to share how others set their helmfiles up.
2020-08-16
2020-08-19
2020-08-20
Does anyone know if you can use remote helm chart values? For instance:
releases:
- name: ingress-internal-{{ requiredEnv "PLATFORM_ENV" }} # name of this release
namespace: ingress
chart: ingress
values:
- git::<ssh://[email protected]:ORG/REPO.git//values/ingress/@internal_{{> requiredEnv "PLATFORM_ENV" }}.yaml?ref=master
wait: true
condition: ingress-internal.enabled
atomic: true
installed: true
helmfile allows to get values from exec, thus you may adapt it with git as a source too
Deploy Kubernetes Helm Charts. Contribute to roboll/helmfile development by creating an account on GitHub.
There are some workarounds like: https://github.com/roboll/helmfile/issues/469#issuecomment-613782055
Also this is merged: https://github.com/roboll/helmfile/pull/1296
Hey, I think it would be awesome to have the option of pulling values files over http/s and git ssh. Something like: values: - https://some-url.com/master/values.yaml.gotmpl - <git://[email protected]>:…
This PR enables the user to specify a remote path for an environment values file, e.g., environments: cluster-azure-us-west: values: - git://git.company.org/helmfiles/global/azur>…
I was thinking https://github.com/roboll/helmfile/pull/1296 is related to values inside environment solely and doesn’t affect release/template values
This PR enables the user to specify a remote path for an environment values file, e.g., environments: cluster-azure-us-west: values: - git://git.company.org/helmfiles/global/azur>…
Ah, @voron probably you are right. Thanks for a tip
@Sam Buckingham may I know how are you using condition in the helmfile
2020-08-24
hey folks, I’m having a really weird issue, where I’m using the same container for local testing and for CI (container has helmfile, terraform, helm, etc) and after I deploy from my local, CI build redeploys everything with a really weird diff:
+ apiVersion: networking.istio.io/v1alpha3
+ kind: VirtualService
+ metadata:
+ name: raven
+ namespace: ccc-testing
labels:
app.kubernetes.io/name: raven
app.kubernetes.io/instance: testing
app.kubernetes.io/component: raven
app.kubernetes.io/part-of: ccc
- app.kubernetes.io/managed-by: Helm
- spec:
- hosts:
- - xxx
- gateways:
- - yyy
- http:
- - headers:
- response:
- set:
- Strict-Transport-Security: "max-age=31536000; includeSubDomains; preload"
- route:
- - destination:
- host: raven
- port:
- number: 8080
- timeout: 10000s
+ app.kubernetes.io/managed-by: Helm
+ spec:
+ hosts:
+ - xxx
+ gateways:
+ - yyy
+ http:
+ - headers:
+ response:
+ set:
+ Strict-Transport-Security: "max-age=31536000; includeSubDomains; preload"
+ route:
+ - destination:
+ host: raven
+ port:
+ number: 8080
+ timeout: 10000s
so essentially its exactly the same contents of the file. any ideas what to look at? and this happens with every rendered file
2020-08-25
Hey @mumoshu, just ran across this funny little message
err 0: glob patterns in release values and secrets is not supported yet. please submit a feature request if necessary
err 1: glob patterns in release values and secrets is not supported yet. please submit a feature request if necessary
apparently you tried to write something similar to
values:
- whatever/*.yaml
which is not yet supported
Haha yup. Was nice to get such a thorough error message
glad to hear it worked! btw, pls feel free to open a feature request if you really need it
Just wrote a small bash script to print out all the files in the dir in a yaml format and use an exec
2020-08-26
When using release templates what’s the difference between
values:
- config/{{`{{ .Release.Name }}`}}/values.yaml
and
valuesTemplate:
- config/{{`{{ .Release.Name }}`}}/values.yaml
? There is not much info about this.
It’s interesting that for secrets there is no template or it’s a typo
Both do the same. *Template
were added to use inside yaml templates to have an ability to merge template and release values. When you use values
in template and values
in release - release values override template values. Same with valuesTemplate
- using it in both template and release leads to release valuesTemplate
overrides template’s one. But when you use valuesTemplate
in template and values
in release(or vise versa) - resulting helm values are merged from values
and valuesTemplate
values. Similar with set/setTemplate
Huge thanks! Is it documented somewhere and I missed it? Or you know it from inspecting the code/following issues?
maybe here
Deploy Kubernetes Helm Charts. Contribute to roboll/helmfile development by creating an account on GitHub.
We use yaml templates, that’s why I’m aware of this.
I’ve seen this, but without trying is hard to get the idea. You description is way better. Thanks again!
np
Guys? How can I override variables if I am using:
# test-helmfile.yaml
environments:
default:
values:
- foo: bar
helmfiles:
- ../../helmfiles.d/global-helmfile.yaml
# global-helmfile.yaml
environments:
default:
values:
- foo: {{ env "FOO" }}
repositories:
releases:
helmfile -f test-helmfile.yaml apply
Problem is that foo
is empty and is overriden by nested helmfile ..
I want to be able to deploy global-helmfile.yaml with environemnt variable support and also test-helmfile.yaml with static vars and possible release override. Any idea?
Solved with:
helmfiles:
- path: ../../helmfiles.d/global-helmfile.yaml
values:
- foo: bar
What does not work me is:
# test-helmfile.yaml
helmfiles:
- path: ../../helmfiles.d/global-helmfile.yaml
values:
- foo: bar
# global-helmfile.yaml
environments:
default:
values:
- foo: {{ requiredEnv "FOO" }}
repositories:
releases:
error calling requiredEnv: required env var `FOO` is not set
foo
var should be overriden with static foo
value, isnt it a bug? @mumoshu
( Its working with {{ env "FOO" }}
, but it can render empty value, if FOO is not specified, which is problematic )
Thanks
foo: bar
is merged AFTER global-helmfile.yaml is executed as a go template. so, it must be {{ env "FOO" }}
if you need to override foo
in the callee side from the caller
hello all,
does anyone know if there is a way to specify environments per release? example:
environments:
development:
staging:
production:
templates:
app: &app
namespace: {{ .Environment.Name }}
chart: charts/{{`{{ .Release.Name }}`}}
missingFileHandler: Error
values:
- apps/{{`{{ .Release.Name }}`}}/values.{{ .Environment.Name }}.yaml
- apps/{{`{{ .Release.Name }}`}}/version.{{ .Environment.Name }}.yaml
releases:
- name: MyApp
<<: *app
- name: MySecondApp
<<: *app
here, is it possible to specify that MySecondApp is only for development?
(I see ways around it like having 3 separate helmfile.<environment>.yaml or having multiple templates but not ideal)
one possible option is to use installed/installedTemplate
in your template or release
installedTemplate: {{ eq .Environment.Name "development" | toYaml }}
another possible option is to use similar condition
environments:
development:
values:
- MySecondApp:
enabled: true
staging:
values:
- MySecondApp:
enabled: false
production:
values:
- MySecondApp:
enabled: false
templates:
...
releases:
- name: MyApp
<<: *app
- name: MySecondApp
condition: MySecondApp.enabled
<<: *app
Of course, you may use files to load environment values instead of inlining
thank you, that helps
2020-08-27
Does anyone else still have problems with releases going to different kubeContext are still getting duplicate release errors?
STDERR:
Error: release: already exists
where do you specify kubeContext
?
at the release level
what helmfile version do you use ?
v0.125.5
could you pls reproduce this error on the latest version, and then retry with --debug
to get actual helm arguments?
I suppose release: already exists
error is from helm, thus your helm may use wrong context. It’s better to test on single release using selector by release name
we use context at helmDefaults
and template level, don’t noticed any unfixed issues.
does this release actually exist ?
helm --kube-context dev_eu-frankfurt-1_dataplane --namespace example ls -la
I suppose this issue is related to helm solely. Are you able to reproduce this issue by executing helm with all these args from debug log ?
well, i can see its issuing the helm release to the same kubecontext twice
that shouldn’t be happening
We are using a nested loop to generate our releases
but it shouldn’t produce this outcome. Here is an example
releases:
{{- range (list "us-ashburn-1" "us-phoenix-1") }}
{{- $region := . }}
{{- range (list "controlplane" "dataplane") }}
{{- $okeKubeContext := (printf "%s_%s_%s" "dev" $region .) }}
- name: example-grafana
chart: bitnami/grafana
kubeContext: "{{ $okeKubeContext }}"
{{- end }}
{{- end }}
ah, dynamic releases. I’m able to reproduce this issue - all the releases get the same kubeContext - the last generated one. It may be by design - you’re on the same single helmfile environment, kubeContext isn’t used as some uniq part to distinguish releases, and releases with the same name+namespace are merged in therms of kubeContex.
File a bug or submit a PR.
Interesting results are with
- name: example-grafana
chart: "{{ $okeKubeContext }}"
kubeContext: "{{ $okeKubeContext }}"
chart is uniq, while k8s context is the same in debug output. This leads to expected release: already exists
But as soon as “release name + namespace” are uniq - no issues - k8s context is uniq too.
- name: "{{ $okeKubeContext }}"
chart: bitnami/grafana
kubeContext: "{{ $okeKubeContext }}"
or
- name: example-grafana
chart: bitnami/grafana
namespace: "{{ $okeKubeContext }}"
kubeContext: "{{ $okeKubeContext }}"
I thought kubecontext WAS used as a unique part to distinguish a release? https://github.com/roboll/helmfile/pull/1390
or at least it was intended to be
and yes, all of your tests above mimic exactly what I’m seeing
@mumoshu just CC’ing you here because I brought this up to you before as well
Currently helmfile does not take kubeContext at the release level into the uniqueness of a release. For a use-case where you want to deploy the same chart to many clusters you have to use dynamic r…
and now you don’t hit duplicate release
error in helmfile, but you get actual duplicate releases.
thank you for all your help
you’re welcome
2020-08-28
Hello! I’m trying to reuse values block for different helmfiles but getting template error: template: stringTemplate26: executing “stringTemplate” at <.Values.location>: map has no entry for key “location” It works if i use the same values in “values block” instead of global environments. Any ideas on how to fix this? Or suggestions how to get what i want other way? Thanks! (I’d like to keep all in one file if possible)
---
environments:
default:
values:
~_ - a: b
+ ---
helmfiles:
~ - path: git::<https://git.com/ops/[email protected]?ref=master>
+ - path: git::<https://git.com/ops/[email protected]?ref=master>
could you pls provide larger example? I don’t see variable location
in your example.
Sure, In addition to the first snippet, suppose
git::<https://git.com/ops/[email protected]?ref=master>
Looks like this:
---
repositories:
~ - name: {{ .Values.a }}
~ url: <https://chartmuseum>.{{ .Values.a }}
~ username: {{ .Values.a }}
~ password: {{ .Values.a }}
helmDefaults:
createNamespace: false
wait: true
timeout: 600
templates:
default: &default
~_ chart: {{ .Values.a }}/{{`{{ .Release.Name }}`}}
missingFileHandler: Warn
releases:
~ - name: cluster-metadata
<<: *default
namespace: kube-system
~ version: {{ .Environment.Values | get "overrides.cluster-metadata" "0.1.0" }}
labels:
default: true
~ app: cluster-metadata
values:
- cluster:
~ location: {{ .Values.a }}
~ zone_prefix: {{ .Values.a }}
~ zone_postfix: {{ .Values.a }}
then error will be during helmfile.yaml.part.0 parsing: template: stringTemplate18: executing “stringTemplate” at <.Values.a>: map has no entry for key “a”
so it cannot template
url: <https://chartmuseum>.{{ .Values.a }}
Which i assume it should get from
environments:
default:
values:
~_ - a: b
In the first file
helmfiles:
allows to specify values per each add helmfile. Did you tried to move your values to file and then specify this file under values? See Advanced Configuration: Nested States
on https://github.com/roboll/helmfile
Deploy Kubernetes Helm Charts. Contribute to roboll/helmfile development by creating an account on GitHub.
That’s my next option. I was hoping to describe all my app layer in one file per cluster :<
It’s not possible then? I should stick with separate files for values?
Just move values to files from the beginning
environments:
default:
values:
- /path/to/values.yaml
I’m not sure if this helps unfortunatelly
You’ll need either a values: block under each sub-helmfile definition or environments: inside each sub-helmfile manifest:)
v0.125.9: Merge pull request #1442 from roboll/fix-duplicate-with-kubectx-per-r… c575587 (HEAD, tag: v0.125.9, origin/master, origin/HEAD, master) Merge pull request <a class=”issue-link js-issue-link” data-error-text=”Failed to load title” data-id=”688441462” data-permission-text=”Title is private”…
c575587 (HEAD, tag: v0.125.9, origin/master, origin/HEAD, master) Merge pull request #1442 from roboll/fix-duplicate-with-kubectx-per-release f2dfa7c Fix kubeContext not taken into account for rele…
…elease Fix kubeContext not taken into account for release uniqueness
v0.126.0: Fix build error after helmfile build --embed-values
addition
cd0ecc5 (HEAD, tag: v0.126.0, origin/master, origin/HEAD, master) Fix build error after helmfile build –embed-values addition
<a class=”commit-link” data-hovercard-type=”commit”…
cd0ecc5 (HEAD, tag: v0.126.0, origin/master, origin/HEAD, master) Fix build error after helmfile build –embed-values addition dc6c59d Print command output in line (#1354) 0fc0869 feat: helmfile bu…
This is a follow-up for #1436
2020-08-29
2020-08-31
Hey All, good morning :slightly_smiling_face: Is it intended that helmfile repos
attempts to template all releases? I was attempting to use it as a pre-step to my releases and it was taking a long time to run. Looking at --debug
, it appears to be templating all the releases.
ah, looks like the trick for my setup is not to supply an env
so no environments are imported/run into the main helmfile, have to use --allow-no-matching-release
v0.126.1: Fix test flake for commonLabels
(#1449)
3e6542e (HEAD, tag: v0.126.1, origin/master, origin/HEAD, master) Fix test flake for commonLabels (<a class=”issue-link js-issue-link” data-error-text=”Failed to load title” data-id=”689738084” data-permission-text=”Title is private”…
3e6542e (HEAD, tag: v0.126.1, origin/master, origin/HEAD, master) Fix test flake for commonLabels (#1449) d3daea3 Fix panic on hook since v0.126.0 (#1448) 19d7942 Add experimental “forceNamespace” …