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.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
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
320
CDCL による厳密解法を採用した MILP ソルバー
imai448
3
200
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
200
TypeScript、上達の瞬間
sadnessojisan
48
14k
DynamoDB でスロットリングが発生したとき/when_throttling_occurs_in_dynamodb_short
emiki
0
270
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
200
アジャイルチームがらしさを発揮するための目標づくり / Making the goal and enabling the team
kakehashi
3
170
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
130
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
960
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
190
Next.jsとNuxtが混在? iframeでなんとかする!
ypresto
1
440
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
130
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Become a Pro
speakerdeck
PRO
25
5k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Music & Morning Musume
bryan
46
6.2k
Embracing the Ebb and Flow
colly
84
4.5k
A Philosophy of Restraint
colly
203
16k
Optimizing for Happiness
mojombo
376
70k
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 ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠