$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How I've Operated Kubernetes on Prod for Half a...
Search
lanocci
March 27, 2019
Technology
0
1.7k
How I've Operated Kubernetes on Prod for Half a Year (FJCT Meetup on Kubernetes #14)
lanocci
March 27, 2019
Tweet
Share
More Decks by lanocci
See All by lanocci
Introduction to Kubernetes Using GKE
lanocci
3
1k
Other Decks in Technology
See All in Technology
突き破って学ぶコンテナセキュリティ/container-breakout-cncj-lt
mochizuki875
6
980
A/Aテストにおけるサンプルサイズ/japanr2024
nikkei_engineer_recruiting
1
160
品質管理チームのEMとして大事にしていること / QA EM
nihonbuson
0
400
今はまだ小さい東京ガス内製開発チームが、これからもKubernetesと共に歩み続けるために
yussugi
3
560
もう一度、 事業を支えるシステムに。
leveragestech
6
3.1k
農業用ダム監視を目的とした衛星SAR 干渉解析の適用性について
osgeojp
0
130
LINEヤフーにおける超大規模プラットフォーム実現への挑戦と学び / Challenges and Lessons in Building an Ultra-Large-Scale Platform at LY Corporation
hhiroshell
3
1k
MySQL 8.0 から PostgreSQL 16 への移行と RLS 導入までの道のりと学び
baseballyama
0
370
ドメインロジックで考えるテスタビリティ
leveragestech
1
270
そろそろOn-Callの通知音について考えてみよう (PagerDuty編)
tk3fftk
1
310
日本全国・都市3D化プロジェクト「PLATEAU」とデータ変換OSS「PLATEAU GIS Converter」の公開
nokonoko1203
4
330
LangChainとSupabaseを活用して、RAGを実装してみた
atsushii
0
120
Featured
See All Featured
Facilitating Awesome Meetings
lara
50
6.1k
How GitHub (no longer) Works
holman
310
140k
Bash Introduction
62gerente
608
210k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
A Tale of Four Properties
chriscoyier
157
23k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
The Cost Of JavaScript in 2023
addyosmani
45
6.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Transcript
,VCFSOFUFTΛ ؒຊ൪ӡ༻͖ͯͯ͠ ϋϚͬͨ͜ͱ !MBOPDDJ 1
,PJDIJ6SBOP!MBOPDDJ w $ZCFS"HFOUΞυςΫελδΦॴଐ w $"%Z7& %41 ʢࣗশʣ43& w $,"
Koichi Urano April 1, 2018 CKA-1800-0366-0100 1 / 1 2
"HFOEB όοΫάϥϯυհ ,VCFSOFUFTͰϋϚͬͨ͜ͱʢ͍͍ҙຯͰʣ ,VCFSOFUFTͰϋϚͬͨ͜ͱʢѱ͍ҙຯͰʣͱͦͷରॲ ·ͱΊ 3
(PBM ΞϓϦέʔγϣϯج൫ͱͯؒ͠ӡ༻͖ͯͨ͠චऀͷܦݧ͔Βɺ๛ͳ ػೳΛඋ͑Δ,VCFSOFUFTͷ͍ํΛ۩ମతʹΠϝʔδͯ͠Β͍ɺগ͠Ͱ ཱ͍ͯͯͨͩ͘͜ͱ͕Ͱ͖ͨΒخ͍͠Ͱ͢ 4
ҙࣄ߲ ͳΔ͘ಛఆͷΫϥυϓϥοτϑΥʔϜʹภΒͳ͍Α͏ɺҰൠԽͨ͠ܗ Ͱ͝આ໌͢ΔΑ͏ʹ͍ͯ͠·͕͢ɺ($1ʹߏஙͨ͠γεςϜ͕ͷݩʹͳͬ ͓ͯΓ·͢ͷͰɺҰ෦($1ಛ༗ͷ͕ग़ͯ͘Δ͔͠Ε·ͤΜ͕ɺԿଔ ͝༰͍ࣻͩ͘͞N @@ N 5
IUUQTBEUFDIDZCFSBHFOUJPBCPVUVT όοΫάϥϯυͷ͝հ 6
w bαΠόʔΤʔδΣϯτάϧʔϓͷΞυςΫϊϩδʔʹ͓͚Δ αʔϏε։ൃɾఏڙΛߦ͏ԣஅ৫` w ऑͷϓϩμΫτ͕͋ΓɺશମͰ໊Ҏ্ͷΤϯδχΞ͕ॴଐ w Πϯϑϥઐͷԣ࣠৫͋ΓɺϓϥΠϕʔτΫϥυڥ͕උ͞Ε ͍ͯΔ 7
ΞυςΫʁ IUUQTBEUFDIDZCFSBHFOUJPQSBSDIJWFT 8
w ΠϯλʔωοτࠂϓϩμΫτʢ%41ʣ w %41ͱ w ࠂओͱϝσΟΞΛͭͳ͙ࠂϓϥοτϑΥʔϜͷ͏ͪɺࠂओͷͨΊͷαʔ ϏεΛఏڙ͢Δͷ w 441ͱݺΕΔϝσΟΞଆͷͨΊͷϓϥοτϑΥʔϜ͔Β͍߹ΘͤΛड͚ɺ ද͍ࣔͨ͠ࠂΛฦ͢
w େنͳ%41ͩͱඵؒສϦΫΤετΛͦΕͧΕNTҎʹฦ͢ 9
ͲΜͳγεςϜʁ Mark Bid Ad SSP དྷ๚௨ ࠂओ)1 ϒϩάهࣄ ܭଌ ࠂϦΫΤετ
σʔλ ूܭɾՃ 10
ࢀߟɿલఏࣝ w .BTUFS w ,VCFSFOUFT$MVTUFSͷཧશൠΛߦ͏ w /PEF w 1PE͕ஔ͞ΕΔϚγϯʢ7.ཧϚγϯʣ w
LVCFDUM w ,VCFSOFUFTΛૢ࡞͢ΔͨΊͷίϚϯυϥΠϯπʔϧ https://kubernetes.io/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro/ 11
ࢀߟɿલఏࣝ w 1PE w ΞϓϦέʔγϣϯͷ࣮ߦʹඞཁͳίϯςφϦιʔεΛ·ͱΊͨͷ w %FQMPZNFOU w 1PEͷ࡞ɺߋ৽Λߦ͏୯Ґ w
ΞϓϦέʔγϣϯछผ͝ͱʹ࡞͓͚ͯ͠ɺΞϓϦέʔγϣϯͷߋ৽૿ઃ Λ؆୯ʹͰ͖Δ w 4FSWJDF w 1PEͷΞΫηεΛநԽ͢Δͷɻϩʔυόϥϯαʹ૬͢ΔϦιʔε 12
https://kubernetes.io/docs/tutorials/kubernetes-basics/expose-intro/ 13 ࢀߟɿલఏࣝ
,VCFSOFUFTͰϋϚͬͨ͜ͱ ʢ͍͍ҙຯͰʣ 14
,VCFSOFUFTͰΑ͔ͬͨ͜ͱ w ϦϦʔεָ͕ʢ͔҆͠શʣ w 7.ʹൺͯγεςϜӡ༻ָ͕ 15
w ϦϦʔεָ͕ʢ͔҆͠શʣ w 7.ʹൺͯγεςϜӡ༻ָ͕ 16 ,VCFSOFUFTͰΑ͔ͬͨ͜ͱ
ϦϦʔεָ͕ w ҙࣝ͠ͳͯ͘ϩʔϦϯάΞοϓσʔτͯ͘͠ΕΔ w ແఀࢭͰΞϓϦέʔγϣϯΛߋ৽Ͱ͖Δ w (JU0QTͱͷੑ͕ߴ͍ w (JUͷঢ়ଶͱΞϓϦέʔγϣϯঢ়ଶΛಉظ w
ΧφϦΞϦϦʔεͱͷੑ͕ߴ͍ w ৽͍͠όʔδϣϯΛগ͚ͩग़͠ɺෆ۩߹͕ग़ͳ͍͜ͱΛ֬ೝ͔ͯ͠ΒશମΛߋ৽ 17
ϦϦʔεָ͕ w (JU0QTʁ 18
ϦϦʔεָ͕ w (JU0QT w XFBWFXPSLT͕ࣾఏএ w IUUQTXXXXFBWFXPSLTUFDIOPMPHJFTHJUPQT w (JUΛA4JOHMF4PVSDFPG5SVUIA །Ұͷਅ࣮ͷใݯ
ͱ͢Δ w ΞϓϦέʔγϣϯίʔυΠϯϑϥͷઃఆશͯ(JUͰཧ͢Δ w (JUͷঢ়ଶͱಈ࡞͍ͯ͠ΔΞϓϦέʔγϣϯͷঢ়ଶΛಉظ͢Δ w (JUͷΑ͏ʹ͍׳ΕͨπʔϧΛ$*$%πʔϧͷத৺ʹਾ͑Δ͜ͱͰɺΤϯδχΞɹɹ ΈΜͳ͕։ൃʹूதͰ͖Δ͠ɺมߋཤྺΛશͯ͢͜ͱ͕Ͱ͖Δ 19
ϦϦʔεָ͕ 20 NFSHF SFMFBTFCSBODI ΞϓϦέʔγϣϯίʔυ ϦϙδτϦ ,TNBOJGFTU ϦϙδτϦ $MPVE#VJME $POUBJOFS3FHJTUSZ
,T&OHJOF NFSHFIPPL NFSHFIPPL NFSHF SFMFBTFCSBODI 13UP SFMFBTFCSBODI QVTI QVMM EFQMPZ ˞؇Ίͷ(JU0QT
ϦϦʔεָ͕ 21 NFSHF SFMFBTFCSBODI NFSHF SFMFBTFCSBODI QVTI QVMM EFQMPZ ਓ͕հࡏ͢Δͷ
(JU)VCͷૢ࡞ NFSHF ͚ͩ ΞϓϦέʔγϣϯίʔυ ϦϙδτϦ ,TNBOJGFTU ϦϙδτϦ ϥΫ ࣦഊ͠ͳ͍
w ϦϦʔεָ͕ʢ͔҆͠શʣ w 7.ʹൺͯγεςϜӡ༻ָ͕ 22 ,VCFSOFUFTͰΑ͔ͬͨ͜ͱ
Ϧιʔεͷ࠷దԽָ͕ w ΦʔτεέʔϦϯά w )PSJ[POUBM1PE"VUPTDBMFS,VCFSOFUFTͷػೳ w ඪͱ͢ΔࢦඪΛઃఆ͓͚ͯ͠ɺͦΕʹ߹ΘͤͯࣗಈͰεέʔϧΞτɺ εέʔϧΠϯͯ͘͠ΕΔ w $16ϝϞϦͷλʔήοτΛ͏͜ͱ͕Ͱ͖ΔͷͪΖΜɺϞχλϦϯά
πʔϧ͔ΒࢦඪΛͱ͖ͬͯͯΧελϜࢦඪͰઃఆ͢Δ͜ͱͰ͖Δ w FH ϦΫΤετͱ͔ 23 UBSHFU$16 $16ฏۉ
Τϥʔରॲ͕ݮͬͨ w ϔϧενΣοΫ w MJWFOFTT1SPCF,VCFSOFUFTͷػೳ %FQMPZNFOU w 1PE͕݈߁Ͱ͋ΔͱΈͳ݅͢Λఆٛͯ͠ɺͦͷ͔݅Β֎ΕͨΒ ࣗతʹ࠶࡞ͯ͘͠ΕΔ
w FH +BWBϓϩηε͕ࢮΜͩΒউखʹ1PEΛ࡞Γͯ͘͠ΕΔ 24
ੑೳ͍ͨͬͯྑ w ,VCFSOFUFTʹࡌ͔ͤͨΒͱݴཱͬͯͬͯੑೳ͕ѱ͍ͱ͍͏͜ͱͳ͍ w ࠂϦΫΤετͷ͏ͪɺҎ্ΛNTҎʹฦ͍ͤͯΔ w ˞΄ͱΜͲ Ҏ্ NTҎ 25
,VCFSOFUFTͰϋϚͬͨ͜ͱ ѱ͍ҙຯͰʣ 26
3PMMJOH6QEBUFͯ͠Δ͕ͣɺɺɺ w ϦϦʔεதʹϨεϙϯεฦͤͳ͘ͳͬͯΔ͕࣌ؒ͋Δ w Ұؾʹ1PE࡞Γ͗͢͠ʁ 27
3PMMJOH6QEBUFͯ͠Δ͕ͣɺɺɺ w 3PMMJOH6QEBUF4USBUFHZ w NBY4VSHF,VCFSOFUFTͷػೳ %FQMPZNFOU w 3PMMJOH6QEBUFதͷ1PE্ݶΛࢦఆ w
NBY6OBWBJMBCMF,VCFSOFUFTͷػೳ %FQMPZNFOU w 3PMMJOH6QEBUFதͷՔಇ1PEͷԼݶΛࢦఆ 28
29 w NBY4VSHFNBY6OBWBJMBCMF w NBY4VSHFNBY6OBWBJMBCMFʹͯ͠Βͣɺɺɺ 3PMMJOH6QEBUFͯ͠Δ͕ͣɺɺɺ old old old old
old new Քಇத ४උத SFQMJDBT NBY4VSHFNBY6OBWBJMBCMFͷ߹ શମ ·Ͱ૿͑ͯ0,Քಇத·Ͱݮͬͯ0, old new new new new new new new new new old old ʜ
3PMMJOH6QEBUFͯ͠Δ͕ͣɺɺɺ w ϦϦʔεதʹϨεϙϯεฦͤͳ͘ͳͬͯΔ͕࣌ؒ͋Δ w ࣮1PE͕ϦΫΤετड͚ΒΕΔঢ়ଶʹͳΔલʹτϥϑΟοΫɹɹɹ ৼΒΕͪΌͬͯΔʁ 30
3PMMJOH6QEBUFͯ͠Δ͕ͣɺɺɺ w Πϝʔδ 31 1PE࡞։࢝ 1PEશͯͷ ίϯςφ͕ىಈ ࡞ͨ͠1PEʹ τϥϑΟοΫ͕ ৼΒΕ࢝ΊΔ
+7.ىಈྃ ʜ ͜ͷؒ ͣͬͱΤϥʔ
3PMMJOH6QEBUFͯ͠Δ͕ͣɺɺɺ w 3FBEJOFTT1SPCF,VCFSOFUFTͷػೳ %FQMPZNFOU w 3FBEJOFTT1SPCFΛࢦఆ͠ͳ͍ঢ়ଶͰɺ,VCFSOFUFT1PE͕ىಈͨ͠ͱಉ࣌ʹ -# 4FSWJDF ʹΈೖΕΔ
w +BWBΞϓϦͰɺ+7.ͷॳظԽΩϟογϡͷॳճಡΈࠐΈ͕Γɺ1PEͷىಈ ͱΞϓϦέʔγϣϯ͕3FBEZͱͳΔλΠϛϯάʹ݁ߏϥά͕͋Δ w ͦ͜Ͱɺ3FBEJOFTT1SPCFͰΞϓϦέʔγϣϯͷ3FBEZͱͳΔ݅ͱͯ͠+BWB ΞϓϦέʔγϣϯ͕ىಈ͢Δ1PSUͷϋʔτϏʔτΛࢦఆ͓͚ͯ͠ɺΞϓϦͷ ىಈલʹΞΫηε͕དྷΔ͜ͱΛ͛Δʁ 32
3PMMJOH6QEBUFͯ͠Δ͕ͣɺɺɺ w 3FBEJOFTT1SPCF 33 1PE࡞։࢝ 1PEશͯͷ ίϯςφ͕ىಈ ࡞ͨ͠1PEʹ τϥϑΟοΫ͕ ৼΒΕ࢝ΊΔ
+7.ىಈྃ ʜ 3FBEJOFTT1SPCF0, 3FBEJOFTT1SPCF /( ղܾ
ݹ͘ͳΓΏ͘,Tͷόʔδϣϯ w ύϒϦοΫΫϥυͬͯΔͱɺ͍ͭͷؒʹ͔ͬͯΔ,Tͷόʔδϣϯ ͕αϙʔτର֎ʹ w /PEFͷόʔδϣϯΛ্͛Δʹ/PEFΛ࠶ىಈ͠ͳ͍ͱ͍͚ͳ͍ w ࠶ىಈͰҰؾʹ1PE͕ࢮΜͩΒࠔΔ 34
ݹ͘ͳΓΏ͘,Tͷόʔδϣϯ w Πϝʔδ w /PEFΛআ͔ͯ͠Β%FQMPZNFOU͕1PEΛ࡞Γ͢ w 35 https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget %FQMPZNFOU" %FQMPZNFOU#
ෛՙूத
ݹ͘ͳΓΏ͘,Tͷόʔδϣϯ w 1PE%JTSVQUJPO#VEHFUNBY6OBWBJMBCMF w SFQMJDBʹରͯ͠Քಇதͷ1PEΛ͔ͭ͠ݮΒ͍͚ͯ͠ͳ͍ w 36 https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget %FQMPZNFOU" %FQMPZNFOU#
ղܾ
ݹ͘ͳΓΏ͘,Tͷόʔδϣϯ w 1PE%JTSVQUJPO#VEHFU,VCFSOFUFTͷػೳ w %FQMPZNFOU͝ͱʹɺ͍ͭ͘·ͰͳΒ1PEΛམͱ͍͍͔ͯ͠ΛఆٛͰ͖ Δ w ͜ͷ݅Λຬͨͤͳ͍Α͏ͳૢ࡞Λߦ͓͏ͱ͢Δͱɺผͷ/PEFʹ৽͍͠ SFBEZঢ়ଶͷ1PE͕Ͱ͖Δ·Ͱૢ࡞ΛਐΊͳ͍Α͏੍ݶͯ͘͠ΕΔ w
όʔδϣϯΞοϓճͯ͠Δ͚Ͳ3FBEJOFTT1SPCFͱͷΈ߹ΘͤͰ ͳ͍ 37
1PE͕ภͬͯΔɻɻɻ w ͋Δछྨͷ1PE͕ಛఆͷ/PEFʹภͬͯ͠·ͬͨ w ͠ͳΜΒ͔ͷཧ༝Ͱ/PEF͕མͪͨΒαʔϏε͕མͪΔ 38
w Πϝʔδ w 1PE͕ภͬͯΔɻɻɻ 39 %FQMPZNFOU" %FQMPZNFOU# %FQMPZNFOU$
1PE͕ภͬͯΔɻɻɻ w *OUFSQPEBOUJB⒏OJUZ,VCFSOFUFTͷػೳ %FQMPZNFOU w ಛఆͷ1PE͕ಈ͍͍ͯΔ/PEFʹରͯ͠৽͍͠1PEΛεέδϡʔϦϯά ͠ͳ͍ઃఆ͕Ͱ͖Δɹ w ͜ΕΛͬͯɺಉҰ%FQMPZNFOUͷ1PE͕͢Ͱʹଘࡏ͍ͯ͠Δ/PEF
ʹεέδϡʔϦϯά͠ͳ͍Α͏ʹઃఆͰ͖Δ 40
w *OUFSQPEBOUJB⒏OJUZͷઃఆ͋ΓʢಉҰ1PE͕ଘࡏ͢ΔϊʔυʹεέδϡʔϦϯά͠ͳ͍ʣ w 1PE͕ภͬͯΔɻɻɻ 41 %FQMPZNFOU" %FQMPZNFOU# %FQMPZNFOU$
γεςϜܥ1PEམͪͯΔ w LVCFQSPYZͱ͍͏ɺϦόʔεϓϩΩγͷΑ͏ͳͷ͕མ͍ͪͯͯɺ1PEͷΞΫη εʹࣦഊ͢Δ w γεςϜܥͷ1PEશͯ%BFNPO4FU͘͠%FQMPZNFOUͳͷͰʢLVCFQSPYZ %BFNPO4FUʣɺͷ͋Δ1PEΛআ͢Εࣗಈతʹ࠶࡞͞Εͯ෮چՄೳ w γεςϜܥ1PEམͪͳ͍อূͳ͍͠ɺো࣌ͷΓ͚͕େมͳͷͰɺɹɹɹ ͪΌΜͱࢹ͓͍ͯͨ͠΄͏͕Αͦ͞͏
w (,&ͳΒΈࠐΈͰTUBDLESJWFS͕ར༻ՄೳɺͪΖΜ%BUBEPHͰࢹՄೳ w TUBDLESJWFSͰ֤ϊʔυͭҎ্LVCFQSPYZ্͕͕͍ͬͯͳ͚ΕΞϥʔτ 42
ʑؾΛ͚͍ͭͯΔ͜ͱ w νʔϜͰษڧձΛߦͬͨΓυΩϡϝϯτΛڞ༗ͨ͠Γͯࣝ͠ͷఈ্͛ w υΩϡϝϯτཧʹ4DSBQCPYΛ͍ͬͯ·͢ IUUQTTDSBQCPYJP w ฤू͘͢͠ɺݕࡧ͍͢͠ w
λάϦϯΫΛͬͯυΩϡϝϯτಉ࢜Λؔ࿈͚ͮͯɺࣝΛܨ͍͚͛ͯΔ w ࣗಈԽ w LVCFDUMΛͳΔ͘ਓ͕ؒୟ͔ͳ͍Α͏ʹ͍ͯ͘͠ w HJU0QT w +FOLJOTΛͬͨΦϖϨʔγϣϯࣗಈԽ 43
·ͱΊ w ϦϦʔε࡞ۀ͕؆୯Ͱ҆શˠߴϦϦʔε w ࣗతʹਖ਼ৗͳঢ়ଶΛҡ࣋ͯ͘͠ΕΔˠলྗӡ༻ w ৭ʑग़ͯ͘Δ͚Ͳɺ,VCFSOFUFTͷΈͷதͰղܾͰ͖ͦ͏ w ୯ʹ,VCFSOFUFTΛ͏͚ͩͰͦͷ··ӡ༻ָ͕ʹͳΔΘ͚Ͱͳ͍ w
,VCFSOFUFTͷػೳΛཧղ্ͨ͠Ͱࡌͤସ͑Εӡ༻Λָʹͯ͘͠ΕΔ 44
,VCFSOFUFTɺ࠷ߴ 45
46 ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠