Helm hooks are nothing more than just regular Kubernetes manifests. It can be any Kubernetes object such as a Job, pod, configmap, secret, etc. The only difference is that helm hooks are not part of the helm chart release. For example, you may want to run database migration before you deploy a new version of the application. You can create a helm hook which will be executed before the application is deployed. In this video we will create two types of helm hooks:
templatesfor our helm hooks
hook: pre-install - indicates type of the hook
hook-weight: “0” - if you have more then one hook you can define an order to execute them all
hook-delete-policy: hook-succeeded - configures lifecycle of that hook, in this case this Kubernetes object will be removed after sucsessful execution.
Next step is to create second
post-install hook, that will be executed after application is deployed
watchcommand to keep track of the pods.
It will run
kubectl get pods every 1 seconds
Now, let’s install it, let’s call our release