Download !!BETTER!! Helmfile

0 views
Skip to first unread message

Leon Marcellus

unread,
Jan 20, 2024, 1:05:14 PM1/20/24
to gorlivetmi

I'm not sure with which helmfile version it last worked (the error occurs at least on 0.153.1+), but I found a few related issues here (initial) and here (allegedly solved) that seem to suggest that actually old versions had this bug but new versions solved it; for me it's exactly the opposite.

download helmfile


Downloadhttps://t.co/wpCeeZLCGD



Deploying Helm Charts with ArgoCD using Helmfile is not supported out of the box. In this article, I will show how to extend ArgoCD using config management plugins to support Helmfile: -helm-charts-using-argocd-and-helmfile/ #argocd #helm #kubernetes #openshift #gitops #cicd

On my helmfile templates exploration, I wish I could use the .Release.Name, to branch, like if you are this chart, do this thingy. The best that can be done is to put the chart specific changes values file that is fetched using .Release.Name as part of the file name. There will undoubtedly be redundancy. In looking at github issues, it would look like that to change this current behavior would require some major refactoring, especially as .Release.Name is determine later in the process.

Is there a sensible way install CRDs from urls prior to installing chart that depends on CRDs availability via just helmfile? For example this chart requires CRDs to be installed via kubectl -charts/tree/main/charts/snapshot-validation-webhook

I have several helmfiles which I want to bundle. So far I do this via helmfiles: in another helmfile.However I then lose the parallel processing of releases. Is there a way to wrap helmfiles and still specify that some of the subhelmfiles can run in parallel?

Hello everyone, Is it possible to construct helmfile dynamically from a yaml config file or some other format? I wanted have a service specific config file where I can define all my dependencies and then on run time it constructs a helmfile

Thanks for your response @Andrew Nazarov . I have common repo which performs some action on all services. I want this common repo to have config file which construct helmfile and deploy on kube clusters

Recently I setup a small skaffold.dev development environment for a platform deployed using helmfile, deployed to a GKE cluster in production that is moving towards also having a local setup using minikube.

skaffold does not know about the helmfile values out of the box, and for this we use a simple on host hook that runs before deployment happens. This script ultimately uses a helmfile tool and write-values command to output a values.yaml file for use in the deployment.

Helm and helmfile are great tools to automate Kubernetes deployments. However, they have some subtleties that are sometimes hard to understand and may lead to catastrophic problems. One of them is the difference between helmfile sync and helmfile apply, a question raised many times, for example in StackOverflow.

Helm generates the Kubernetes manifests to apply to a Kubernetes cluster by "compiling" a Chart's templates against some values, that can come from the chart's values.yaml or the values override (defined in helmfile, passed using the --set option of the cli, etc.). All those information together (chart, values, options) is what we will call a state.

The helmfile sync command will run helm upgrade on all releases. This means all releases will have their revision incremented by one. However, as Helm does three-way strategic merges, if there is no change between the live and desired state, no patch will actually be applied: there is just a new helm-release secret created.

The helmfile apply command will run helm upgrade only when there are changes. However, to detect changes, helmfile uses the helm-diff plugin, which only computes the difference between the old vs desired state; it doesn't look at the live state (similar to Helm 2). If something changed outside of Helm, helm-diff will return "no change", and the release won't be upgraded.

UPDATE (May 2022): helm-diff added support for three-way merge diffs on v3.3.0 (January 10, 2022). As the helm-diff process inherits the environment from the helmfile process, one can do:

helmfile.yaml defines the bases, the nested helmfiles and defaults. The base files are merged together and with the helmfile.yaml file before processing the rest of files. The following snippet shows its contents.

Under the helmfiles directive you can specify the file or files in which the Helm releases are defined. To keep this example as simple as possible, all the releases will be placed within the same file (releases/releases.yaml). The helmDefaults directive provides a lot of different options to customize the behavior of the underlying Helm CLI.

Helmfile provides a sync command that allows to synchronize the contents of the state files (repos, releases and chart dependencies), and it is advisable to execute it periodically to ensure that the releases deployed are up to date. The main difference between helmfile apply and helmfile sync is that the former just apply changes if any difference is detected, while the second syncs all the resources.

Helmfile offers a declarative way to define your helm releases. Since our charts all follow roughly the same directory structure, we can easily define a general purpose helmfile.yaml that we can add to our charts.

Helm has an excellent diff plugin which makes it easy to see exactly what you are changing in an upgrade. Combined with the changes in helm3 you can use it to declaratively set the state of a helm release. Fortunatley, we don't lose that functionality with helmfile!

Helmfile also provides a handy command called helmfile apply that terraform lovers may find familiar. By running it with the interactive mode flag (-i), you can get the diff of your release and immediately run the release if you like it:

But what if we only want to deploy 1 or two of our charts? Again, helmfile has the answer: labels. By putting our releases into one helmfile.yaml and giving them labels we can release the whole stack or only the portions we need.

TIP: I also defined the image tags in the release using default "stable" . This lets me easily set those tags using an env variable and not clutter the helmfile command with extra --set flags. This is especially handy in the CI/CD server since we are already passing around environment variables there for settings.

The helmfile sync sub-command sync your cluster state as described in your helmfile. The default helmfile is helmfile.yaml, but any YAML file can be passed by specifying a --file path/to/your/yaml/file flag.

Note that delete doesn't purge releases. So helmfile delete && helmfile sync results in sync failed due to that releases names are not deleted but preserved for future references. If you really want to remove releases for reuse, add --purge flag to run it like helmfile delete --purge.

The helmfile lint sub-command runs a helm lint across all of the charts/releases defined in the manifest. Non local charts will be fetched into a temporary folder which will be deleted once the task is completed.

The environment name defaults to default, that is, helmfile sync implies the default environment.The selected environment name can be referenced from helmfile.yaml and values.yaml.gotmpl by .Environment.Name .

First you must have the helm-secrets plugin installed along with a.sops.yaml file to configure the method of encryption (this can be in the same directory as your helmfile orin the sub-directory containing your secrets files).

helmfile -f path/to/directory loads and runs all the yaml files under the specified directory, each file as an independent helmfile.yaml.The default helmfile directory is helmfile.d, that is,in case helmfile is unable to locate helmfile.yaml, it tries to locate helmfile.d/*.yaml.

Hooks associated to prepare events are triggered after each release in your helmfile is loaded from YAML, before execution.prepare hooks are triggered on the release as long as it is not excluded by the helmfile selector(e.g. helmfile -l key=value).

In contrast to the per release hooks mentioned above these are run only once at the very beginning and end of the execution of a helmfile command and only the prepare and cleanup hooks are available respectively.

Once you download all required charts into your machine, you can run helmfile charts to deploy your apps.It basically run only helm upgrade --install with your already-downloaded charts, hence no Internet connection is required.See #155 for more information on this topic.

Copy autocomplete/helmfile_bash_autocomplete or autocomplete/helmfile_zsh_autocomplete (depending on your shell of choice) to directory where you keep other shell completion scripts to make sure it is sourced.

Note that $(pwd) is necessary when hemlfile.yaml has one or more sub-helmfiles in nested directories,because setting a relative file path in --output-dir or --output-dir-template results in each sub-helmfile renderto the directory relative to the specified path.

To use helmfile with ACR, on the other hand, you must either include a username/password in the repository definition for the ACR in your helmfile.yaml or use the --skip-deps switch, e.g. helmfile template --skip-deps.

I have self hosted retool via Retool Helmchart, no whenever I login I see no Apps created. I want to give it my apps JSON when the retool pod is starting so that it will create a new app and show me that app. Can I achieve his by passing the JSON through the helmfile values or some other way?

Instead of trying to understand how all those values work (and creating specific .gotmpl files for each release), here is how I managed to mimic the umbrella chart behavior regarding values with helmfile (one default value file + one file per environment, with global section and sections).

Not sure I understand your point. The . refers to helmfile values, and won't be passed to helm, so assigning it doesn't really matter. pick and get both return the globals dict (sole difference is the copy) and merge will anyways don't touch the second (globals) dict. Finally, in umbrella charts children don't have access to parent's values (only what is in globals and under their own name). Or am I missing something?

df19127ead
Reply all
Reply to author
Forward
0 new messages