Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kubernetes helm & helmc
Search
Aya (Igarashi) Ozawa
June 20, 2016
Technology
3
3.6k
Kubernetes helm & helmc
Helm is package management tool for Kubernetes.
This slide describe how to use helm!
Aya (Igarashi) Ozawa
June 20, 2016
Tweet
Share
More Decks by Aya (Igarashi) Ozawa
See All by Aya (Igarashi) Ozawa
KubeCon: To Infinity and Beyond: Seamless autoscaling with in-place resource resize for Kubernetes Pods
ladicle
0
160
FinOps! Optimizing Kubernetes Costs with Karpenter
ladicle
0
160
Kubernetes: API Priority and Fairness
ladicle
1
760
FinOps! karpenterによるk8sコスト削減
ladicle
2
710
明日から使える(?)逆引きKubernetes
ladicle
2
1.3k
Recap: KubeCon+CloudNativeCon 2021 NA / Kubernetes Meetup Tokyo #47
ladicle
0
280
KubeCon+CloudNativeCon Europe 2020 Overview
ladicle
0
210
Think Design About Pretty kubectl Plugins
ladicle
0
380
Kubernetesを拡張して日々のオペレーションを自動化する
ladicle
18
7.6k
Other Decks in Technology
See All in Technology
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
190
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
730
ハイテク休憩
sat
PRO
2
120
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
2
240
KubeCon NA 2024 Recap: How to Move from Ingress to Gateway API with Minimal Hassle
ysakotch
0
200
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
kargoの魅力について伝える
magisystem0408
0
200
Qiita埋め込み用スライド
naoki_0531
0
860
Snowflake女子会#3 Snowpipeの良さを5分で語るよ
lana2548
0
220
MLOps の現場から
asei
6
630
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
160
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
180
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
3k
Music & Morning Musume
bryan
46
6.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Side Projects
sachag
452
42k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
For a Future-Friendly Web
brad_frost
175
9.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Site-Speed That Sticks
csswizardry
2
190
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Unsuck your backbone
ammeep
669
57k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Transcript
1 k8s helm & helmc Kubernetes meetup Tokyo #2
2 ABOUT ME Software Engineer I’m developing cloud services. AYA
IGARASHI NTT Communications @Ladicle
3 AGENDA INTRODUCTION 01 02 03 ࠓ·Ͱͷཧํ๏ 04 HOW TO
MANAGE MANIFESTS? ABOUT K8S HELM & HELMC WHICH IS BETTER? HAPPY HELMING ͲΜͳͷ͔ɺҧ͍Կ͔ ͲͪΒΛͲͷΑ͏ͳߏͰ͏͖͔ ·ͱΊ
4 How to mange Manifests?
5 BASH MANAGEMENT of MANIFEST 1 source env.sh 2 printf
"cat <<++EOS\n%s\n++EOS\n" "$(cat *service.yaml *deployment.yaml)" \ 3 | sh > all-in-one.yaml ڥ͝ͱʹมߋ͍ͨ͠Λbashมͱͯ͠ManifestʹຒΊࠐΈɺ ࣮ߦ͍ͨ͠ڥͷઃఆϑΝΠϧΛಡΈࠐΜͰ͔ΒγΣϧܳΛ͍ͯͨ͠ ࠓ·Ͱ 1 apiVersion: extensions/v1beta1 2 kind: Deployment 3 metadata: 4 name: rabbitmq${SUFFIX} 5 spec: 6 replicas: ${REPLICA_NUMBER} 7 template: 8 metadata: 9 labels: 04 02 rabbitmq-deployment.yaml labelsҎ߱লུ͍ͯ͠Δ install-service-and-deployment.sh env.shͷதͰมΛexport
6 PROBLEMS MANAGEMENT of MANIFEST 01 DUPLICATE DEFINITIONS containersͷenvϑΟʔϧυʹෳͷϑΝΠϧʹڞ ௨ͷڥม͕ఆٛ͞Ε͍ͯΔͨΊɺमਖ਼࿙Ε͕
ൃੜ͢Δɻ(࿈ྻ͕͍͍ͨ….) 02 HARD TO READ γϯϓϧʹߏతͳมΛఆٛͰ͖ͳ͍ͨΊઃఆ ϑΝΠϧ͕ಡΈͮΒ͍ɻ 03 YAML LINT IS NOT ENOUGH ৺ͷฏԺͷͨΊmanifestΛk8sΠϯετʔϧ͢Δલ ʹࢼݧΛ࣮ࢪ͔͕ͨͬͨ͠ɺYAML lintͰ݁Ռ͕ PASSEDͰ͋ͬͯk8sͰಈ͔ͳ͍͜ͱ͕ଟʑ͋ͬͨɻ PROBLEM BASH
7 By Helm
8 What is Helm? ABOUT K8S HELM & HELMC GolangͷTemplate֦ுϥΠϒϥϦͰ͋ΔSprigͷه๏ΛͬͯManifestϑΝΠϧΛ
ఆٛ͢Δ͜ͱ͕Ͱ͖Δɻ·ͨɺαϒίϚϯυͱͯ͠จ๏νΣοΫΛߦ͏ lintίϚϯυ͕ఏڙ͞Ε͍ͯΔɻ K8SͷύοέʔδϚωʔδϟ 1 # Githubb্Ͱެ։͞Ε͍ͯΔnginxύοέʔδΛݕࡧ 2 $ helmc search nginx 3 example-nginx - An example nginx + git-sync application 4 nginx - Nginx http service 5 nginx-alpine - Nginx http service 6 7 # KubernetesnginxΛΠϯετʔϧ͢Δ 8 $ helmc install nginx 9 ---> No chart named "nginx" in your workspace. Fetching now. 10 ---> Running `kubectl create -f` ... 11 service "nginx" created 12 replicationcontroller "nginx" created 13 ---> Done
9 Diff Helm Helmc
10 ALL Different HELM CLASSIC KUBERNETES HELM Oct 18, 2015ʹDEISʹΑͬͯ࡞ΒΕͨ
CLIͰChartͷ࡞/আ/ߋ৽͕Ͱ͖Δɻ ChartͷόʔδϣϯGitͷSHAsͰఆ ͞Ε͍ͯΔɻ Nov 1, 2015ʹk8sऔΓࠐ·ΕͨΫϥΠΞ ϯταʔόܕͷπʔϧɻ12FactorAppͷࢥ ΛͱʹChart + Config = Release ͱ͍͏ ߏΛͱ͍ͬͯΔɻ What is Chart? k8sͷΠϯελϯεΛ࡞͢ΔͨΊʹඞཁͳ ςϯϓϨʔτ/ͷू߹ମ
11 02 KUBERNETES GITHUB install uninstall NGINX WORD PRESS MYSQL
HELMC CHART FILES publish, fetch Create using kubectl Helm Classic ABOUT K8S HELM & HELMC
12 02 KUBERNETES install chart delete Release TILLER CHART FILES
Kubernetes Helm ABOUT K8S HELM & HELMC HELM REST/JSON gRPC STORAGE NGINX WORD PRESS MYSQL Create Chart files contain Chart packages Package Chart files NGINX CHART PACKAGE get/update Release TarBall
13 Which is Better?
14 Which is better? Kubernetes Helm·ͩόʔδϣϯAlpha-1͕ϦϦʔε͞Ε ͔ͨΓͰಈ͔ͳ͍ͷ͕ଟ͍ͨΊɻ Which is better?
Now HELM CLASSIC Helm Classicϝϯςφϯε͞Εͳ͘ͳΔͨΊɺ͋Δఔ҆ఆ͔ͯ͠ ΒҠͬͨํ͕Α͍ɻϩʔυϚοϓʹΑΔͱBeta1ʹChart.yamlͷ ϑΥʔϚοτΛFix͢ΔΒ͍͠ͷͰͦͷࠒʹҠಈͯ͠Αͦ͞͏ ROAD MAP: https://github.com/kubernetes/helm/issues/694 Feature KUBERNETES HELM
15 How to use Helmc
16 How to use Helmc? WHICH IS BETTER? ςϯϓϨʔτͱมݟ௨͕͠Α͍Α͏ʹσΟϨΫτϦΛ৽ͨʹ͍ͬͯΔɻ ·ͨɺมڥ͝ͱʹϑΝΠϧΛׂ͠ڞ௨ͷσϑΥϧτtemplateʹఆ͍ٛͯ͠Δɻ
FILE STRUCTURE Variable file format HelmcͰมϑΝΠϧͷϑΥʔϚοτJSON/ YAML/TOMLͷத͔ΒબͰ͖Δ͕ɺk8s HelmTOML ͷΈͷͨΊɺҠߦͷ͔͢͠͞ΒTOML͕͓͢͢Ί deployments-generator.sh ࣍ϖʔδͰઆ໌͢ΔCustomize generator͔Βݺͼͩ ͍ͯ͠ΔManifestͷੜεΫϦϓτ └── rabbitmq ├── Chart.yaml ├── README.md ├── deployemnts-generator.sh ├── manifests ├── templates │ ├── service.yaml │ └── deployment.yaml └── variables └── lab1.toml.tpl └── lab2.toml.tpl
17 Custom Generator WHICH IS BETTER? deployments-generator.sh (ൈਮ) ( 1
# helm:generate $HELM_GENERATE_DIR/deployemnts-generator.sh 2 apiVersion: extensions/v1beta1 3 kind: Deployment 1 echo "deploymentType = \"${type}\"" > $tempdir/values.toml 2 3 for type in "age" "hoge"; do 4 helmc template -d $tempdir/values.toml \ 5 -o manifests/${type}-deployment.yaml $HELM_GENERATE_FILE 6 done deployment.yaml (ൈਮ) templateίϚϯυΛͬͯManifestΛੜ͢Δͱ֤ϑΝΠϧຖʹ࣮ߦ͠ͳ͚ΕͳΒͳ͍͕ɺgenerateί ϚϯυΛ༻͢ΔͱҎԼͷdeployment.yamlͷΑ͏ʹҰߦʹgenerator͕ࢦఆ͞Ε͍ͯΔͷΛChartσΟ ϨΫτϦͷத͔Βऩू͠ɺҰׅͯ͠ManifestΛੜ͢Δ͜ͱ͕Ͱ͖Δɻ(Jenkinsͱͷ૬ੑΑ͠ʂ)
18 More Information
19 More Information HAPPY HELMING 01 02 03 http://slack.kubernetes.io/ KUBERNETES
SLACK #HELM CHANNEL MEETING ON ZOOM JAPANESE DOCUMENT Contribution ·ͩ·ͩ࢝·͔ͬͨΓͷ໘ന͍ϓϩδΣΫτ খ͞ͳόάFIXͰRV, MG͞ΕΔ खॱଞͷk8sϓϩδΣΫτͱಉ͡Ͱ͢ https://engineyard.zoom.us/j/ https://github.com/Ladicle/kubernetes-helm-jp-doc
20 HAPPY HELMING! Thanks for watching @ladicle