본문으로 건너뛰기

Helm 명령어로 애플리케이션 배포하기

설치

$HOME/.zshrc
source <(helm completion zsh)

Repository

클라이언트에서 Repository 관리

helm repo add <repositoryName> <URL> [flags]

e.g., helm repo add stable https://charts.helm.sh/stable

helm repo list [flags]
helm search repo <keyword> [flags]
  • -l, --versions: 여러 버전을 표시합니다.
helm repo update [repositoryName1 [repositoryName2 ...]] [flags]

Repository 서버

e.g., https://github.com/lol-iot/helm-charts

Chart

Custom Chart 만들기

helm create <chartName> [flags]
<chartName>/
├── Chart.yaml
├── LICENSE # optional
├── README.md # optional
├── values.yaml
├── values.schema.json # optional
├── charts/
├── crds/ # optional
├── templates/
│ ├── NOTES.txt # optional
│ ├── _helpers.tpl # optional
│ └── ...
└──

배포될 리소스 미리보기

helm template <releaseName> <repositoryName/chartName|chartPath> [flags]

Chart 패키징

helm package <chartPath> --version <version>
helm pull <repositoryName/chartName> --version <version>
helm pull <chartURL> --version <version>
helm pull --repo <repoURL> <chartName> --version <version>

리소스 배포

helm show values <repositoryName/chartName|chartPath> [flags]
helm install <releaseName> <repositoryName/chartName|chartPath> [flags]
정보

helm upgrade <releaseName> <repositoryName/chartName|chartPath> --install [flags] 을 사용하면, 설치되어 있지 않은 경우 설치하고, 설치되어 있는 경우 업그레이드합니다.

  • -f <path>: 오버라이드 할 YAML 설정 파일
  • --set <name>=<value>: 오버라이드 할 설정
helm status <releaseName> [flags]
helm test <releaseName> [flags]

배포 관리

helm list [flags]
  • 설치된 릴리즈의 NAME, NAMESPACE, REVISION, UPDATED, STATUS, CHART, APP VERSION 표시
  • -A|--all-namespaces
helm upgrade <releaseName> <repositoryName/chartName|chartPath> [flags]
  • -i|--install: 설치가 안되어 있으면 설치합니다.
helm get values <releaseName> [flags]
helm get manifest <releaseName> [flags]
helm history <releaseName> [flags]
helm rollback <releaseName> <revision> [flags]

배포 삭제

helm uninstall <releaseName> [flags]

Dependency 추가하기

추가하고자 하는 차트의 정보를 <chartPath>/Chart.yaml 파일의 dependencies 항목에 추가합니다.

<chartPath>/Chart.yaml
dependencies:
- name: <name>
version: <version>
repository: <repository>
condition: <name>.enabled
  • repository
    • https://...
    • file://...
    • oci://...

추가한 차트가 application 타입인 경우 <chartPath>/values.yaml 파일에 <name> 항목을 추가하여 서브차트의 값을 설정할 수 있습니다.

<chartPath>/values.yaml
global: {}

<name>:
enabled: true
# subchart values
helm dependency update [<chartPath>]

update 명령어는 Chart.yaml파일을 바탕으로 charts/ 디렉토리를 업데이트합니다.

helm dependency list [<chartPath>]
helm dependency build [<chartPath>]

build 명령어는 Chart.lock파일을 바탕으로 charts/ 디렉토리를 업데이트합니다.