[Cloude] Helm

MeltingOlafยท2022๋…„ 5์›” 27์ผ
0

[Cloud]

๋ชฉ๋ก ๋ณด๊ธฐ
22/25

โœ”๏ธ Helm

Version 3์‚ฌ์šฉ

โœ”๏ธ Helm ์„ค์น˜ํ•˜๊ธฐ

$ curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
$ sudo apt-get install apt-transport-https --yes
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
$ sudo apt-get update
$ sudo apt-get install helm

~/.zshrc
์ž๋™์™„์„ฑ ๊ธฐ๋Šฅ ์ถ”๊ฐ€

...
plugins=
        (git
        zsh-autosuggestions
        zsh-completions
        kubectl
        helm
        )
...

Helm Chart ๊ฒ€์ƒ‰
https://artifacthub.io/

์ฐจํŠธ ๊ตฌ์กฐ

<Chart Name>/
  Chart.yaml
  values.yaml
  templates/
  • Chart.yaml: ์ฐจํŠธ์˜ ๋ฉ”ํƒ€๋ฐ์ดํƒ€
  • values.yaml: ํŒจํ‚ค์ง€๋ฅผ ์ปค์Šคํ„ฐ๋งˆ์ด์ฆˆ/์‚ฌ์šฉ์žํ™”
  • templates: YAML ์˜ค๋ธŒ์ ํŠธ ํŒŒ์ผ

โœ”๏ธ helm ์‚ฌ์šฉ๋ฒ•

aritifacthub ๊ฒ€์ƒ‰

$  helm search hub <PATTERN>

์ €์žฅ์†Œ ์ถ”๊ฐ€ํ•˜๊ธฐ

$ helm repo add worepress https://charts.bitnami.com/bitnami
$ helm repo list
NAME            URL
worepress       https://charts.bitnami.com/bitnami

์ €์žฅ์†Œ ๊ฒ€์ƒ‰ํ•˜๊ธฐ

$ helm search repo wordpress

์ฐจํŠธ ์„ค์น˜ํ•˜๊ธฐ

$ helm install [NAME] [CHART] [flags] 

๋ฆด๋ฆฌ์ฆˆ ํ™•์ธ

$ helm list

๋ฆด๋ฆฌ์ฆˆ ์‚ญ์ œ

$ helm uninstall mywordpress

์ฐจํŠธ ์ •๋ณด ํ™•์ธ

$ helm show readme [Chart]/wordpress
$ helm show chart [Chart]/wordpress
$ helm show values [Chart]/wordpress

์ฐจํŠธ ์‚ฌ์šฉ์žํ™”

$ helm install mywp [Chart]/wordpress --set replicaCount=2
$ helm install mywp [Chart]/wordpress --set replicaCount=2 --set service.type=NodePort

๋ฆด๋ฆฌ์ฆˆ ์—…๊ทธ๋ ˆ์ด๋“œ

$ helm show value [Chart]/wordpress > wp-value.yaml
ํŒŒ์ผ ์ˆ˜์ •
$ helm upgrade mywp [Chart]/wordpress -f wp-value.yaml

๋ฆด๋ฆฌ์ฆˆ ์—…๊ทธ๋ ˆ์ด๋“œ ํžˆ์Šคํ† ๋ฆฌ

$ helm history mywp

๋ฆด๋ฆฌ์ฆˆ ๋กค๋ฐฑ

$ helm rollback mywp 1

wp-value2.yaml

replicaCount: 1

service:
  type: LoadBalancer
$ helm upgrade mywp bitnami/wordpress -f wp-value2.yaml
profile
How R U Today :)

0๊ฐœ์˜ ๋Œ“๊ธ€