Search code examples
hookkubernetes-helmkubectl

Want to exclude a kubectl job from helm installation


want to exclude a kubectl job from helm installation and helm upgrade. Checked helm hook but didn't find any suitable tag for that. Can I create a custom tag for helm hook. Is there any way where I can run my job with helm command apart from install or upgrade.


Solution

  • You can pass a variable while running your install/upgrade helm.

    By doing it you can use this variable and create a condition inside your hook before running it.

    To pass this variable you need to use the option --set while running helm command.

    helm upgrade . --set initSetup=false

    This variable can be tested inside your hook as it's made on common helm charts as on this one.