Search code examples
kuberneteskubernetes-helm

Running kubectl commands Helm post install


I would like to run some kubectl commands to verify the cluster post install of Helm charts. I could not find any documentation around this. In Helm, theres the concept of showing notes as part of NOTES.txt but doesnt look like you can run any commands at that stage.

Is this currently impossible to do with Helm ?


Solution

  • You can define a job that is executed at a certain point in the lifecycle during helm install. The list of available hooks also contains a post-install hook you are probably looking for. An example can be found in the official documentation.

    You basically provide a Kubernetes Job, add necessary helm labels and then also an annotation like this:

      annotations:
        "helm.sh/hook": post-install
    

    In case you are looking for something running on the client side, maybe you can use or create a Helm plugin. There is a list in the official documentation: Helm Plugins. You can find some more by filtering GitHub repositories for the topic helm-plugin.

    There are ideas for future development to support Lua for scripting plugins. But the current format will still be supported.