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.6k
The Cloud Native Chronicles: 10 Years of Community Growth Inside and Outside Japan
inductor
0
96
Cracking the KubeCon CfP
inductor
3
430
KubeCon Recap -Platform migration at Scale-
inductor
1
930
コンテナビルド最新事情 2022年度版 / Container Build 2022
inductor
3
440
データベースとストレージのレプリケーション入門 / 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
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.6k
複雑なState管理からの脱却
sansantech
PRO
1
130
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
350
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
230
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.3k
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
Featured
See All Featured
For a Future-Friendly Web
brad_frost
175
9.4k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Bash Introduction
62gerente
608
210k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Designing for humans not robots
tammielis
250
25k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
A designer walks into a library…
pauljervisheath
203
24k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Fireside Chat
paigeccino
34
3k
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