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
How I've Operated Kubernetes on Prod for Half a...
Search
lanocci
March 27, 2019
Technology
0
1.8k
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
そのコンポーネント、サーバー?クライアント?App Router開発のモヤモヤを可視化する補助輪
makotot
4
530
浸透しなさいRFC 5322&7208
hinono
0
120
新規案件の立ち上げ専門チームから見たAI駆動開発の始め方
shuyakinjo
0
120
Backboneとしてのtimm2025
yu4u
4
1.5k
[CV勉強会@関東 CVPR2025 読み会] MegaSaM: Accurate, Fast, and Robust Structure and Motion from Casual Dynamic Videos (Li+, CVPR2025)
abemii
0
190
ECS モニタリング手法大整理
yendoooo
1
120
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
2
20k
実践アプリケーション設計 ①データモデルとドメインモデル
recruitengineers
PRO
2
240
kintone開発チームの紹介
cybozuinsideout
PRO
0
73k
広島銀行におけるAWS活用の取り組みについて
masakimori
0
130
実践データベース設計 ①データベース設計概論
recruitengineers
PRO
2
240
Preferred Networks (PFN) とLLM Post-Training チームの紹介 / 第4回 関東Kaggler会 スポンサーセッション
pfn
PRO
1
190
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
480
How STYLIGHT went responsive
nonsquared
100
5.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
Raft: Consensus for Rubyists
vanstee
140
7.1k
Docker and Python
trallard
45
3.5k
A designer walks into a library…
pauljervisheath
207
24k
Why Our Code Smells
bkeepers
PRO
338
57k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
4 Signs Your Business is Dying
shpigford
184
22k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
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 ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠