Search code examples
kuberneteschartshookkubernetes-helm

Can a HelmChart pre-install hook, modify chart resources?


The goal: Using Helm Chart pre-install hook, take a file on the filesystem, encode it and place it as a resource file (referenced by a configMap.

Questions:

  • Can a Helm Chart pre-install hook access files that are not under the root chart?
  • Can a Helm Chart pre-install hook modify or add a file under the Chart root?
  • Other then implicitly writing the bash script inside the chart resource yaml, can the pre-install hook execute a bash script if it is placed in the chart?

Solution

  • No, Hooks run as Jobs inside the Kubernetes cluster, so they have no access to your workstation. What you want is the Events system (https://github.com/helm/community/blob/master/helm-v3/002-events.md) which is still a WIP I think.