HomeTutorsContact
Helm - Kubernetes Package Manager
Helm Chart Hooks Tutorial
Anton Putra
April 07, 2021
1 min

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:

  • pre-install Executes after templates are rendered, but before any resources are created in Kubernetes
  • post-install Executes after all resources are loaded into Kubernetes

Prerequisites

  • Helm Client

Sections

  • Create Helm Chart
  • Install Helm Chart

Create Helm Chart

  • First, let’s create a helm chart called foo
  • Create folder under templates for our helm hooks
  • Create first pre-install helm hook
  • 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

  • The only difference here is a post-install hook annotation

Install Helm Chart

  • Before we install our chart, let’s split the screen and run watch command 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 test.

  • Finally, let’s delete out Helm Chart

Tags

#helm#kubernetes

Anton Putra

DevOps Engineer

Big Data | DevOps engineer with hands-on experience in building large, scalable batch and real-time applications with Apache Spark, Hive, Flink on top of Kubernetes; designing and developing CI/CD pipelines.

Expertise

Kubernetes
Terraform
AWS
GCP

Social Media

youtubefacebooklinkedinwebsite

Related Posts

Secrets
Helm 3 Secrets Tutorial
November 13, 2020
1 min
© 2021, All Rights Reserved.

Quick Links

About UsContact Us

Social Media