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.3k
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
1.4k
The Cloud Native Chronicles: 10 Years of Community Growth Inside and Outside Japan
inductor
0
94
Cracking the KubeCon CfP
inductor
3
430
KubeCon Recap -Platform migration at Scale-
inductor
1
930
コンテナビルド最新事情 2022年度版 / Container Build 2022
inductor
3
430
データベースとストレージのレプリケーション入門 / 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
740
オンラインの技術カンファレンスを安定稼働させるための取り組み / SRE activity for online conference platform
inductor
1
1.2k
Kubernetesネットワーキング初級者脱出ガイド / Kubernetes networking beginner's guide
inductor
19
5.9k
Other Decks in Technology
See All in Technology
Spring Frameworkの新標準!? ~ RestClientとHTTPインターフェース入門 ~
ogiwarat
2
260
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
1
400
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
3
260
製造現場のデジタル化における課題とPLC Data to Cloudによる新しいアプローチ
hamadakoji
0
200
利きプロセススケジューラ
sat
PRO
4
2.6k
Postmanの日本市場におけるDevRel (的) 活動 / Postman's DevRelish activities in Japan
yokawasa
1
120
信頼性に挑む中で拡張できる・得られる1人のスキルセットとは?
ken5scal
1
400
2024年グライダー曲技世界選手権参加報告/2024 WGAC report
jscseminar
0
200
組み込みLinuxの時系列
puhitaku
4
1k
TinyGoを使ったVSCode拡張機能実装
askua
2
200
Windows Autopilot Deployment by OSD Guy
tamaiyutaro
0
300
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
130
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Producing Creativity
orderedlist
PRO
341
39k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Automating Front-end Workflow
addyosmani
1366
200k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
BBQ
matthewcrist
85
9.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
4 Signs Your Business is Dying
shpigford
180
21k
Unsuck your backbone
ammeep
668
57k
Done Done
chrislema
181
16k
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