110.10 c

Description: To explain helm, it's a way of managing Kubernetes resources in a package, because it's hard to manage multiple commands every time, every time in different environments, so we make it into code. It's a kind of Kubernetes IaC (Infrastructure as Code), so the minimum requirement is that you have a Kubernetes cluster running and have knowledge about that.

#100#Infra#110#DevOps_Engineer_Infra#110.10#Kubernetes#110.10 c#Helm

Chart is a Helm package. It contains all the resource definitions needed to run applications, tools, and services inside a Kubernetes cluster. You can think of it as the equivalent of a Homebrew formula, Apt dpkg, or YUM RPM file in Kubernetes.

A repository is a place to collect and share charts. This is like Perl's [CPAN archive] (https://www.cpan.org/) or [Fedora Package Database] (https://src.fedoraproject.org/), but for Kubernetes packages.

A release is an instance of a chart running on a Kubernetes cluster. Typically, a chart can be installed multiple times in the same cluster. Each time it is installed, a new release is created.

Install helm

# Download helm
    - echo "start helm download"
    - 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
    - echo "finish helm download"

helm uninstall

get release_name and namespace_name
helm list -A

(Example) Releas name is my-argo , namespace name is argocd-ns


NAME   	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART         	APP VERSION
my-argo	argocd-ns  	1       	2024-04-26 01:02:09.175995975 +0000 UTC	deployed	argo-cd-6.7.15	v2.10.7

helm uninstall <release_name> -n <namespace_name>

Helm upgrade

After you change values.yaml or service.yaml or etc, You have to notify it to helm

helm upgrade <release-name> <helm file path> -n <namespace name>

ex)
some_path/fastapi

ls -l
total 8
drwxr-xr-x  3 user1  staff   96 Apr 30 13:09 __pycache__
-rw-r--r--  1 user1  staff  707 Apr 30 13:09 main.py
drwxr-xr-x  7 user1  staff  224 Apr 30 14:42 myfastapiapp

helm list -n test
NAME      	NAMESPACE	REVISION	UPDATED                           	STATUS  	CHART             	APP VERSION
my-release	test     	3       	2024-04-30 15:37:05.8187 +0900 KST	deployed	myfastapiapp-0.1.0	1.16.0

helm upgrade command
helm upgrade my-release ./myfastapiapp -n test

Worker Node의 IP tables 확인
sudo iptables -L -n -t nat | grep KUBE