Suppose u want to start Postgres internally on ur K8s Cluster. You need to create multiple manifest files deployment.yml , secret.yml , service.yml , pvc.yml ( start all these resources )
Package Management in K8s provides u way to bring all these files to K8 Cluster without starting it from scratch. Structure of all these files would be same, just that values will be configurable
- Your DB should have only 1 replica, you shouldn’t be writing from 2 different places to DB.
Benefits of Helm for Package Management
- Templating : You are allowed to change parameters. You create helm chart ( package ) that are reusable. It can be configured using templates.
- Versioning
- Upgrades : Can upgrade to newer version of helm chart
- Dependency Management
- Release Management : Can rollback
- Simplified Sharing : Can share ur helm chart
- Consistency across environments
Creating helm chart
Step 1 : Create K8s Cluster
eksctl create cluster --name helm-cluster --region ap-south-1 --nodes 3 --node-type t2.medium
- Install AWS ECS CBI Driver ( Refer Volumes )
Step 2 : Install Helm locally
brew install helm
Step 3 : Install the postgres helm chart
helm install postgres oci://registry-1.docker.io/bitnamicharts/postgresql
Step 4 : To see the files being applied locally