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
Kubectl Apply 2019: 闇の魔術に対する防衛術 / Kubectl Apply...
Search
Kohei Ota
June 18, 2019
Technology
7
3.4k
Kubectl Apply 2019: 闇の魔術に対する防衛術 / Kubectl Apply 2019: Defence Against the Dark Arts
A talk at Kubernetes Meetup Tokyo #20 @ Google Japan Office
Kohei Ota
June 18, 2019
Tweet
Share
More Decks by Kohei Ota
See All by Kohei Ota
CloudNative Meets WebAssembly: Exploring Wasm's Potential to Replace Containers
inductor
3
2k
The Cloud Native Chronicles: 10 Years of Community Growth Inside and Outside Japan
inductor
0
110
Cracking the KubeCon CfP
inductor
2
490
KubeCon Recap -Platform migration at Scale-
inductor
1
950
コンテナビルド最新事情 2022年度版 / Container Build 2022
inductor
3
450
データベースとストレージのレプリケーション入門 / Intro-of-database-and-storage-replication
inductor
26
6.1k
KubeConのケーススタディから振り返る、Platform for Platforms のあり方と その実践 / Lessons from KubeCon case studies: Platform for Platforms and its practice
inductor
3
780
オンラインの技術カンファレンスを安定稼働させるための取り組み / SRE activity for online conference platform
inductor
1
1.2k
Kubernetesネットワーキング初級者脱出ガイド / Kubernetes networking beginner's guide
inductor
19
6k
Other Decks in Technology
See All in Technology
あなたの知らないクラフトビールの世界
miura55
0
130
dbtを中心にして組織のアジリティとガバナンスのトレードオンを考えてみた
gappy50
0
280
AWS re:Invent 2024 recap in 20min / JAWSUG 千葉 2025.1.14
shimy
1
100
あなたの人生も変わるかも?AWS認定2つで始まったウソみたいな話
iwamot
3
860
AWSサービスアップデート 2024/12 Part3
nrinetcom
PRO
0
140
月間60万ユーザーを抱える 個人開発サービス「Walica」の 技術スタック変遷
miyachin
1
140
テストを書かないためのテスト/ Tests for not writing tests
sinsoku
1
170
AWS Community Builderのススメ - みんなもCommunity Builderに応募しよう! -
smt7174
0
180
When Windows Meets Kubernetes…
pichuang
0
310
Godot Engineについて調べてみた
unsoluble_sugar
0
410
FODにおけるホーム画面編成のレコメンド
watarukudo
PRO
2
280
Goで実践するBFP
hiroyaterui
1
120
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Designing for Performance
lara
604
68k
A designer walks into a library…
pauljervisheath
205
24k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
Thoughts on Productivity
jonyablonski
68
4.4k
Unsuck your backbone
ammeep
669
57k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
Side Projects
sachag
452
42k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Typedesign – Prime Four
hannesfritz
40
2.5k
Transcript
,VCFDUM"QQMZ %FGFOTF"HBJOTUUIF%BSL"SUT !@JOEVDUPS@ ,VCFSOFUFT.FFUVQ5PLZP
,VCFDUM"QQMZ ҋͷຐज़ʹର͢ΔӴज़ !@JOEVDUPS@ ,VCFSOFUFT.FFUVQ5PLZP
,VCFDUM"QQMZ ҋͷຐज़ʹର͢ΔӴज़ !@JOEVDUPS@ ,VCFSOFUFT.FFUVQ5PLZP
ࣗݾհ w 5XJUUFS!@JOEVDUPS@ w (JU)VC!JOEVDUPS w .-0QT&OHJOFFS!;0;05FDI w 'BWPSJUFIPVTF)V⒐FQV⒎
ηογϣϯͷΞδΣϯμ w ,VCF$PO&6ݸਓతؾʹͳͬͨৼΓฦΓ NJO w ຊͷ3FDBQ NJO w
ֶͼΛӡ༻ʹಋೖ͢Δʹ NJO w ·ͱΊ
,VCF$PO&6 w ॴεϖΠϯ όϧηϩφ w ࢀՃऀਓҎ্ w γΞτϧਓ ͷͪϦετ
w ίϖϯϋʔήϯਓ
,VCF$PO&6
None
None
None
None
None
None
None
,VCFDUM"QQMZ ҋͷຐज़ʹର͢ΔӴज़
ҋͷຐज़ʁ
ҋͷຐज़ʁ
ຊͷલʹͭ֬ೝ
,VCFDUMBQQMZͷཪଆͰ Կ͕ى͍ͬͯ͜Δͷ͔
,VCFSOFUFTΞʔΩςΫνϟͷ ͓͞Β͍
None
w ͯ͢ͷϦΫΤετ"1*4FSWFSΛܦ༝ w FUDE͕4JOHMF4PVSDFPG5SVUI w $POUSPMMFS.BOBHFS͔Βݺͼग़͞Εͨ$POUSPMMFS͕࣮ࡍͷ ॲཧʢϦιʔεͷ࡞আʣΛߦ͏
IUUQTHJUIVCDPNKBNJFIBOOBGPSE XIBUIBQQFOTXIFOLT
IUUQTTQFBLFSEFDLDPNEBJLVSPTBXB LVCFSOFUFTTPVSDFDPEFSFBEJOH
͜Ε·Ͱͷ,VCFDUMBQQMZͷಈ࡞ w "QQMZ3FTPVSDF$POpHΛ༻͍ͨʮએݴతͬΆ͍ʯϦιʔεཧ w "QQMZͰ͞Εͨ$POpHΛύʔε w ,VCFSOFUFT্ʹ࣮ࡏ͢ΔϦιʔεΛಡΈऔΓ w $SFBUFɺ1BUDIɺ%FMFUFͳͲͷ໋ྩతͳ"1*ϦΫΤετΛߏங
None
એݴతͳΠϯϑϥཧ WT ໋ྩతͳ"1*ͷݺͼग़͠ͱ͍͏࣮ଶ
None
None
IUUQTRJJUBDPNULVTVNJ JUFNTCGDFGC
ઃఆ߲ͷଥੑʁ w ,VCFSOFUFTʹ͢$POpH͕ਖ਼͍͜͠ͱΛ୭͕Ͳ͏ͬͯ୲อ͢Δͷ͔ w ESZSVOΛ͏ʁ w ΫϥΠΞϯταΠυʹͯɺ"1*ʹ࣮ࡍʹ͢ϦΫΤετΛੜ͢ΔίϚϯυ w ͍ΘΏΔʮESZSVOʯͱҧ͍ɺ"1*αʔόͱΓͱΓ͠ͳ͍ w
PΦϓγϣϯͰZBNMܗࣜͷग़ྗͰ͖Δ͕ɺΓϦΫΤετ͕Ͳ͏ͳΔ ͔ΛγϛϡϨʔγϣϯͰ͖ΔΘ͚Ͱͳ͍ͷͰɺ͕ͨͪຊདྷཉ͔ͬͨ͠ ESZSVOͱҧ͏
None
˞ࠇຐज़ʹ͖ͭ Α͍͜ͷΈΜͳਅࣅ͠ͳ͍ͰͶʂ
"QQMZ͢ΔલʹϢʔβʔ͕ ,Tʹظ͢ΔΞϓϩʔν w ԼهͭΛ·ͱΊͯEJ⒎Λ͍͍ײ͡ʹද͍ࣔͨ͠ w ݱଘ͢ΔϦιʔε w ࠷ޙʹద༻ͨ͠$POpH w ͜Ε͔Βద༻͍ͨ͠$POpH
w ࠩͷΈਖ਼͘͠1BUDIϦΫΤετΛૹΓ͍ͨ
"QQMZ͢ΔલʹϢʔβʔ͕ ,Tʹظ͢ΔΞϓϩʔν w ԼهͭΛ·ͱΊͯEJ⒎Λ͍͍ײ͡ʹද͍ࣔͨ͠ w ݱଘ͢ΔϦιʔε w ࠷ޙʹద༻ͨ͠$POpH w ͜Ε͔Βద༻͍ͨ͠$POpH
w ࠩͷΈਖ਼͘͠1BUDIϦΫΤετΛૹΓ͍ͨ
៉ྷʹϦΫΤετΛੜ͢Δ ʹͲ͏͖͢ͳͷ͔
҆͝৺͍ͩ͘͞ʂ ,VCFSOFUFTଆͰରԠ͞Ε·ͨ͠
,VCFSOFUFTͷมߋ w 4FSWFSTJEFBQQMZ w "QQMZͷΤϯυϙΠϯτʹ৽ͨͳϑϥά͕Ճ w ۙͰద༻͞Εͨ$POpHͱͷ%J⒎ΛऔΕΔΑ͏ʹ w ΫϥΠΞϯταΠυͰ໋ྩΛ͝ʹΐ͝ʹΐ͠ͳͯ͘Α͘ͳͬͨ
,VCFSOFUFTͷมߋ w ΫϥΠΞϯταΠυ w ࣮ࡍͷ,VCFSOFUFTϢʔβએݴతʹϦιʔεΛཧ͍ͨ͠ w ϦιʔείϯϑΟάΛू w $POpH.BQ4FDSFUTͳͲͷ୯Ұʹ࡞ΒΕΔϦιʔε w
ˠ$-*πʔϧʹ,VTUPNJ[FΛ౷߹
,VCFSOFUFTͷมߋ w ,VCFDUMEJ⒎ w 4FSWFSTJEFBQQMZͱESZSVOͷΞϓϩʔνΛ౷߹ w ͭ·Γɺݱଘ͢ΔϦιʔε͕ߟྀ͞ΕͨEJ⒎͕ग़ྗ͞ΕΔ w ࣍ʹBQQMZ͢Δͱ͖ʹͲͷΑ͏ͳ݁ՌʹͳΔ͔͕໌֬ʹ
·ͨ·ͨ͊ɺͲ͏ͤ·ͩ ϦϦʔε·Ͱ͔͔࣌ؒΔΜͰ͠ΐʁ
͍ͭ͑ΔΑ͏ʹͳΔͷ͔ w ,VCFDUMEJ⒎ w ͔Β$-*ʹՃ͞Ε͓ͯΓར༻Մೳ w "1*4FSWFSଆͷόʔδϣϯࣗମରԠ͕ඞཁ
͍ͭ͑ΔΑ͏ʹͳΔͷ͔ w $-*ʹ͓͚Δ,VTUPNJ[Fͷ౷߹Խ w ͔Β$-*ʹՃ͞Ε͓ͯΓར༻Մೳ w ͪ͜Β७ਮͳ$MJFOU4JEF'FBUVSFͳͷͰɺαʔόଆͷ όʔδϣϯʹґଘͤͣར༻͕Մೳ
ࠓޙͷϩʔυϚοϓʁ w 1SVOFͷվળ w ཁ͢Δʹ͍͍ײ͡ʹϦιʔεΛআ͢Δํ๏ w ੜ͞Εͨ$POpH.BQ4FDSFUTͷ͓আػೳΛ͚ͭΔ w 4UBUVT w
طଘͷϦιʔελΠϓ$3%ͳͲʹର͢Δએݴతมߋͷ ίϯτϩʔϥىಈ࣌ͷϒϩοΩϯάΛαϙʔτ
ࠓޙͷϩʔυϚοϓʁ w ,VCFDUM,VTUPNJ[F w ౷߹͞Εͨࠓޙʹ͍ͭͯ,VTUPNJ[FࣗମͷΞοϓετ ϦʔϜ։ൃܧଓ w ,VTUPNJ[Fଆ͕,VCFDUMଆΑΓৗʹ࠷৽ w ,VCFDUMͷϓϩδΣΫτLVCFSOFUFTLVCFDUMͷϦϙδ
τϦʹҠߦத
·ͱΊ w ,VTUPNJ[Fͷ౷߹Խʹؔͯ͠ར༻ࣗମҙ w طʹಋೖ͍ͯ͠ΔਓʹͱͬͯϥοΩʔ w EJ⒎͕͑ΔΑ͏ʹͳͬͨͷͰɺͲ͜ͰͲΜͳ͕ࠩΔ͔͕໌֬ʹ w ʢݸਓతʹʣṖͷ͕ࠩൃੜͯ͠υΩϡϝϯτړΔ͕࣌ؒݮͬͨ
ͱ͋Δ,VCFSOFUFTར༻ऀ͔ΒΈͨɺ ຊηογϣϯʹର͢Δֶͼͱ࣮ફ
ͱ͋Δ,VCFSOFUFTར༻ऀ͔ΒΈͨɺ ຊηογϣϯʹର͢Δֶͼͱ࣮ફ
"QQMZͷා͞ w ਖ਼Ͳ͏ͬͯಈ͍ͯΔͷ͔Α͘Θ͔ΒͣͬͯΔʢʣ w Կࠩൃੜͯ͠ͳ͍ͣͳͷʹ$POpHVSFEʹͳͬͯ1PE ͕5FSNJOBUJOHʹͳͬͨ͜ͱ͕͋Δ w Ϋϥελͱ͔/BNFTQBDFؒҧ͑ͯ"QQMZͪ͠ΌͬͯΞϨͳ ͜ͱʹͳͬͨ͜ͱ͕͋Δ
ZBNMϑΝΠϧͷཧ w ڥ͝ͱʹ͍͍ͪͪ࡞ΔͷΊΜͲ͍͘͞ w Լखʹڞ௨Խ͢Δͱมͷཧͱ͔େม w ઃܭϛεΔͱҋುʹͳΓ͕ͪ w ڥYαʔϏεͰͲΜͲΜ͕૿͍͑ͯ͘
P kubernetes @MELANIECEBULA kubectl apply Production Deployment Canary Deployment Production
ConfigMap Canary ConfigMap Production Service Canary Service kubernetes cluster Dev Deployment Dev ConfigMap Dev Service kubernetes config files lots of boilerplate repetitive by environment resources environments
:".-ͷzਖ਼͍͠zཧํ๏ ͕Θ͔Βͳ͍
None
ΠϯϑϥߏཧͷύΠϓϥΠϯ w ͦͦ,VCFSOFUFT͕:".-Λ͍ͬͯΔͷ એݴతʹߏཧ͕Ͱ͖Δʢͱ͞Ε͍ͯΔʣ͔Β w :".-ͷΈͱ͍͏ΑΓɺΠϯϑϥߏཧͷΈ w ߏཧͷͲ͜ʹΈΛ๊͍͑ͯΔ͔ w ূΛ͍ͨ͠
w ώϡʔϚϯΦϖϨʔγϣϯΛݮΒ͍ͨ͠ w ࣗಈతʹөͯ͠Γ͕͠Ͱ͖ΔΑ͏ͳΈʹ͍ͨ͠
Θ͕··ϘσΟͰ ͢Έ·ͤΜ
ੈͷதʹ͍͔ͭ͘ͷํ๏͕͋Δ w (JU0QT w 8FBWFXPSLT͕ఏএͨ͠ɺ(JUΛ4JOHMF4PVSDFPG5SVUI ͱ͢ΔࣗಈԽϑϩʔͷܗ w 1VMMܕͷ$%͕(JUͷεςʔλεΛఆظతʹνΣοΫͯ͠ ڥʹө͢Δ w
(JUʹ1VTIͯ͠ຊ൪ʹࣗಈө͢Δͭ$*0QT
ʁʁʁʮ$*0QTΞϨͳͷͰ (JU0QTʹ͠Α͏ͥʯ
Θ͔ΔΜ͚ͩͲɾɾɾ w (JU0QTେมͦ͏ w $%πʔϧΛ৽͘͠ݐͯͳ͍ͱ͍͚ͳ͍ w ΠϯϑϥͷߏཧΛཧ͢ΔͨΊͷ$%πʔϧͷߏཧ w ͿͬͪΌ͚ͦΜͳنେ͖͘ͳ͍͠ͳ͋
ͳʹʁ ,VCFDUMʹEJ⒎͕ೖΔͩͱ
,VCFDUMEJ⒎͕ͨΒ͢ޫ w ϝϦοτ w $*πʔϧͰEJ⒎ͱͬͯϩά͕ͤΔΑ͏ʹͳͬͨ w ࠷ͰߦՃ͢Δ͚ͩͳͷͰΒͪ͘Μ w σϝϦοτ w
ࠜຊతͳ͕ղܾ͢ΔΘ͚Ͱͳ͍ w ϩʔϧόοΫͳͲ૬มΘΒͣҰఆͷͭΒΈ͕͋Δ w ,VCFSOFUFTͷΤίγεςϜͰΧόʔ͍͔ͯ͘͠͠ͳ͍
͏ʔΜͰɺZBNM͍ͬͺ͍͋Δͱཧ େมʹͳΔ͠EJ⒎͏γʔϯ࣮ݶΒΕ ͯΔΜ͡Όͳ͍͔ͳ͋ʁ
͑ʁ ,VCFDUMʹ,VTUPNJ[F͕ೖΔͩͱ
,VTUPNJ[Fͷ౷߹͕ͨΒ͢ޫ w ϝϦοτ w ܧঝܕͷςϯϓϨʔτ͕ॻ͚Δ w ϕʔεͭͷ··ʹɺࣗ༝ʹ֦ு֤ͯ͠ڥɾαʔϏεʹల։͕Մೳ w %3:͗͢Δڞ௨Խͷ੍ݶ͕ͳ͍ w
σϝϦοτ w ࠜຊతʹϑΝΠϧ͕ݮͰ͖ΔΘ͚Ͱͳ͍ w ग़ྗ݁Ռ͕Ͳ͔͜ʹΔΘ͚͡Όͳ͍
͜ͷͭͷมߋ͕ͨΒ͢ޫ w ͦͷ࣌ʑʹ͓͚ΔZBNMͷग़ྗ݁Ռ͕อূ͞ΕΔ ,VTUPNJ[F (JU w ࣮ࡍʹ࣮ߦ͞Εͨͱ͖ͷөঢ়گ͕Θ͔Δ EJ⒎
w طଘͷߏʹରͯ͠େ͖͘Ճ͑Δมߋ͕ͳ͍ w ࣮֬ʹطଘͷߏΑΓϦεΫΛݮΒͭͭࣗ͠ಈԽΛ࣮ݱͰ͖Δ
͑ͷͳ͍͜ͷઓ͍ʹ ྑ͍ϥΠϯ͕Ҿ͚ͦ͏ʢʁʣ
݁Ռߟ͑ͨߏ w ߏ w $*0QT ,VTUPNJ[F EJ⒎Ͱ͕ΜΔ w બఆཧ༝ w
ͦΜͳʹن͕େ͖͘ͳ͍ w (JU0QT͕ΜΕΔ΄Ͳӡ༻νʔϜ͕ख़͍ͯ͠ͳ͍ w 4JNQMFJTCFTU
͜͜Ͱ͍͍ײ͡ͷΞʔΩςΫνϟਤ Λγϡοͱग़͢
ແ೦ʢ࣌ؒΓͳ͔ͬͨʣ
·ͱΊ w ,VCFSOFUFTͷΞʔΩςΫνϟͬ͘͟ΓͰ͓͖ͬͯ͘ w ࣗͷӡ༻ίετʹݟ߹͏ྗΛ͢Δ w "DUJWF%FWFMPQNFOUͳϓϩδΣΫτ6QTUSFBNͷػೳʹؔ͢Δ ใΛੵۃతʹऔΓೖΕ͍͖ͯ͘
࠷ޙʹ͜Ε͚ͩݴ͍͍ͨ
,VCFSOFUFTZBQQB OBONPXBLBSBO
5IBOLZPVGPS ZPVSBUUFOUJPO