[Kubernetes] Helm

“Helm” is a package management tool for applications that run in the Kubernetes cluster.

https://helm.sh/docs/intro/using_helm/

Install Helm

https://helm.sh/docs/intro/install/

  • You can install using the script.
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3

chmod 700 get_helm.sh

./get_helm.sh

helm version

Concepts

Charts

  • A Chart is a Helm package.
  • It contains all the resource definitions necessary to run an application inside a Kubernetes cluster.

Repositories

  • A Repository is a place where charts can be collected and shared.
  • You can browse and download charts from the repository.

Releases

  • A Release is an instance of a chart running in a Kubernetes cluster.

How to Use Helm

Artifact Hub Search

# search hub searches "https://artifacthub.io"
helm search hub wordpress

Local Repo Search

# add a local repo
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add brigade https://brigadecore.github.io/charts

# update the repo
helm repo update

# check the local repo
helm repo list

# search the local repo
helm search repo wordpress
helm search repo nginx

Install Packages

It is a good idea to use a namespace to isolate the changes.

kubectl create ns wordpress

# helm install {release-name} {chart-name} {flags} 
helm install my-wp bitnami/wordpress -n wordpress

# check the release
kubectl get all -n wordpress

It creates everything you need to run the WordPress website.


Check the status

helm list -n wordpress

helm status my-wp -n wordpress

A chart includes the following files:

  • template yaml files
  • values.yaml: configurable values
  • Chart.yaml: the information about the chart

You can look at the chart files like this:

mkdir my-charts
cd my-charts

helm pull --untar bitnami/wordpress

cd wordpress
ls
ls templates
cat Chart.yaml
cat values.yaml

Clean up

It is easy to clean up all resources from the helm release.

helm uninstall my-wp -n wordpress

kubectl get all -n wordpress

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s