helm-www icon indicating copy to clipboard operation
helm-www copied to clipboard

Misleading documentation of .helmignore

Open Flauschbaellchen opened this issue 4 years ago • 2 comments

Within the documentation for the .helmignore file [1], it is is stated that:

The .helmignore file is used to specify files you don't want to include in your helm chart.

If this file exists, the helm package command will ignore all the files that match the pattern specified in the .helmignore file while packaging your application.

However, the .helmignore file is also interpreted if running helm install or helm upgrade.

Expected behavior Files are only ignored if running helm package but interpreted if running other sub-commands, like install.

Current behavior Files are always ignored independent of the sub-command.

Use case I do have a sub-folder named ca-certifcates within my helm directory. The Helm chart includes a secret specification, which automatically add all files within this directory as secret-data. This allows the user to customize the containers to handle connection to servers with self-signed certificates etc.

The secret specification is:

---
apiVersion: v1
kind: Secret
metadata:
  name: ca-certificates
data:
{{ (.Files.Glob "ca-certificates/*").AsSecrets | indent 2 }}

The secret is then mounted into the containers which in turn have an entrypoint handling those files and adding them to the CA store of the OS.

Using .helmignore, the files are ignored even for install and upgrade, which renders the secret to being empty.

Current workaround Prior to running helm package I manually remove all files not needed within the Helm chart and leave the .helmignore empty,

Notes Are there any other workarounds, which allows to have files within the directory structure of Helm, but do not include them when running the package sub-command?

Flauschbaellchen avatar Aug 12 '21 12:08 Flauschbaellchen