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
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
230
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
690
CDCL による厳密解法を採用した MILP ソルバー
imai448
3
140
Can We Measure Developer Productivity?
ewolff
1
150
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.9k
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
The Rise of LLMOps
asei
7
1.7k
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
【Pycon mini 東海 2024】Google Colaboratoryで試すVLM
kazuhitotakahashi
2
540
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
430
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
180
21k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Bash Introduction
62gerente
608
210k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Designing the Hi-DPI Web
ddemaree
280
34k
Designing for humans not robots
tammielis
250
25k
Become a Pro
speakerdeck
PRO
25
5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Site-Speed That Sticks
csswizardry
0
28
Why Our Code Smells
bkeepers
PRO
334
57k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
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