Helm 명령어로 애플리케이션 배포하기
설치
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
Repository
클라이언트에서 Repository 관리
helm repo add <repositoryName> <URL> [flags]
Ex) 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/hhk7734/helm-charts
Chart
Custom Chart 만들기
helm create <chartName> [flags]
Chart.yaml
: https://helm.sh/docs/topics/charts/- https://helm.sh/ko/docs/chart_template_guide/builtin_objects/
- https://helm.sh/ko/docs/chart_template_guide/functions_and_pipelines/
_<name>.tpl
: https://helm.sh/ko/docs/chart_template_guide/named_templates/
<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]
--install
: 설치가 안되어 있으면 설치합니다.
helm get values <releaseName> [flags]
helm get manifest <releaseName> [flags]
helm history <releaseName> [flags]
helm rollback <releaseName> <revision> [flags]
배포 삭제
helm uninstall <releaseName> [flags]
Subcharts
- https://helm.sh/docs/helm/helm_dependency/
- https://helm.sh/docs/chart_template_guide/subcharts_and_globals/
<chartName>/
├── charts/
│ ├── <subchartName>/
│ │ ├── Chart.yaml
│ │ ├── LICENSE # optional
│ │ ├── README.md # optional
│ │ ├── values.yaml
│ │ ├── values.schema.json # optional
│ │ ├── charts/
│ │ ├── crds/ # optional
│ │ ├── templates/
│ │ │ ├── NOTES.txt # optional
│ │ │ ├── _helpers.tpl # optional
│ │ │ └── ...
│ │ └──
│ └── ...
└── ...
<chartName>/Chart.yaml
dependencies:
- name: <subchartName>
version: <subchartVersion>
condition: <subchartName>.enabled
<chartName>/values.yaml
<subchartName>:
enabled: true
# subchart values