클라우드프로그래밍 10주차 — Helm으로 애플리케이션 패키징
쿠버네티스 패키지 매니저 Helm으로 차트를 설치·업그레이드하고, 값 오버라이드와 리비전 관리를 확인한 10주차 기록.
클라우드프로그래밍 10주차 — Helm으로 애플리케이션 패키징
10주차는 쿠버네티스 패키지 매니저 Helm 으로 애플리케이션을 차트(chart)로 설치·업그레이드한다. 7주차에 만든 클러스터에서 진행했다.
핵심 개념
- Helm: 여러 YAML(Deployment/Service/ConfigMap…)을 차트 하나로 묶어 변수(
values)로 매개변수화하고,install/upgrade/rollback/uninstall로 릴리스를 관리한다. - Repository: 차트를 모아 배포하는 저장소(예:
https://kiamol.net). - Release: 차트를 클러스터에 설치한 인스턴스. 업그레이드마다 REVISION 이 증가해 롤백할 수 있다.
Helm 다루기
Helm 버전 / 저장소 추가
1
2
3
4
5
6
7
$ helm version --short
v4.2.2+gb05881c
$ helm repo add kiamol https://kiamol.net
"kiamol" has been added to your repositories
$ helm repo update
Update Complete. ⎈Happy Helming!⎈
차트 검색 & 기본값 확인
1
2
3
4
5
6
7
8
$ helm search repo vweb --versions
NAME CHART VERSION APP VERSION DESCRIPTION
kiamol/vweb 2.0.0 2.0.0 Simple versioned web app
kiamol/vweb 1.0.0 1.0.0 Simple versioned web app
$ helm show values kiamol/vweb --version 1.0.0
servicePort: 8090
replicaCount: 2
차트 설치 (값 오버라이드)
1
2
3
4
5
6
7
8
9
$ helm install --set servicePort=8010 --set replicaCount=1 ch10-vweb kiamol/vweb --version 1.0.0
NAME: ch10-vweb
LAST DEPLOYED: Tue May 26 21:30:00 2026
STATUS: deployed
REVISION: 1
$ kubectl get deploy,rs -l app.kubernetes.io/instance=ch10-vweb
deployment.apps/ch10-vweb 1/1 1 1
replicaset.apps/ch10-vweb-6d5fd9b8f5 1 1 1
업그레이드 (replica 1 → 3)
1
2
3
4
5
6
7
8
9
10
11
$ helm upgrade --set servicePort=8010 --set replicaCount=3 ch10-vweb kiamol/vweb --version 1.0.0
Release "ch10-vweb" has been upgraded. Happy Helming!
$ helm ls
NAME REVISION STATUS CHART APP VERSION
ch10-vweb 2 deployed vweb-1.0.0 1.0.0 # REVISION 2
$ kubectl get pods -l app.kubernetes.io/instance=ch10-vweb
ch10-vweb-6d5fd9b8f5-25zbt Running
ch10-vweb-6d5fd9b8f5-2c7xf Running
ch10-vweb-6d5fd9b8f5-5qh9r Running # 3개로 스케일됨
웹 접속
차트는 LoadBalancer 서비스를 만든다. 로컬 단일 노드(kind) 환경에는 외부 LB가 없어 EXTERNAL-IP 가 <pending> 이므로 port-forward 로 접속했다.
1
2
3
4
5
6
7
$ kubectl get svc ch10-vweb
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
ch10-vweb LoadBalancer 10.96.69.206 <pending> 8010:32049/TCP
$ kubectl port-forward svc/ch10-vweb 8010:8010 &
$ curl -s http://localhost:8010 | grep -o '<title>.*</title>'
<title>v1</title>
정리
1
2
$ helm uninstall ch10-vweb
release "ch10-vweb" uninstalled
정리
--set 으로 같은 차트를 다른 설정(포트/레플리카)으로 설치하는 방식은, 5주차에서 다룬 Docker 환경변수 주입의 쿠버네티스 버전에 해당한다. helm upgrade 시 REVISION이 1→2로 증가하며, 이 릴리스 이력이 롤백의 근거가 된다. kind 환경의 LoadBalancer <pending> 은 실제 클라우드(예: AWS ELB)였다면 외부 IP가 할당될 부분으로, 1~2주차의 클라우드 LB 개념과 연결된다.
This post is licensed under CC BY 4.0 by the author.
