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
390
Kubernetesを拡張して日々のオペレーションを自動化する
ladicle
18
7.6k
Other Decks in Technology
See All in Technology
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
0
180
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
250
podman_update_2024-12
orimanabu
1
270
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
190
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
550
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
460
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
3
280
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
750
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
110
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
320
UI State設計とテスト方針
rmakiyama
2
590
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
480
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Embracing the Ebb and Flow
colly
84
4.5k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Writing Fast Ruby
sferik
628
61k
A Philosophy of Restraint
colly
203
16k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
How STYLIGHT went responsive
nonsquared
95
5.2k
A better future with KSS
kneath
238
17k
The Invisible Side of Design
smashingmag
298
50k
How GitHub (no longer) Works
holman
311
140k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
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