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
オンプレ Kubernetes クラスタの全サーバーを宣言的に再起動する方法
Search
Daichi Sakaue
January 21, 2021
Programming
1.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
オンプレ Kubernetes クラスタの全サーバーを宣言的に再起動する方法
Daichi Sakaue
January 21, 2021
Other Decks in Programming
See All in Programming
Modding RubyKaigi for Myself
yui_knk
0
910
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
280
Claspは野良GASの夢をみるか
takter00
0
180
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.3k
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
740
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
5
3.4k
Lessons from Spec-Driven Development
simas
PRO
0
150
Inside Stream API
skrb
1
680
ふつうのFeature Flag実践入門
irof
7
3.7k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
320
Oxcを導入して開発体験が向上した話
yug1224
4
300
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
530
Featured
See All Featured
A Soul's Torment
seathinner
6
2.9k
Fireside Chat
paigeccino
42
3.9k
From π to Pie charts
rasagy
0
200
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
160
The SEO Collaboration Effect
kristinabergwall1
1
480
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Done Done
chrislema
186
16k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
190
Abbi's Birthday
coloredviolet
2
8k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
330
Transcript
オンプレ Kubernetes クラスタの全サーバーを 宣⾔的に再起動する⽅法 2021/01/21 yokaze (Cybozu, Inc.)
⾃⼰紹介 ▌@yokaze l Cybozu l Kubernetes クラスタの運⽤ ▌今⽇の内容は技術ブログのダイジェスト版 l 詳細に興味がある⽅は
https://blog.cybozu.io/entry/2020/12/25/134334
Kubernetes クラスタの全ノードを再起動したい ▌⽬的 l ファームウェア更新 l 多くの場合、更新後に再起動が必要 l セキュリティ対応 l
アプリの耐障害性の確認 l カオスエンジニアリング ▌条件 l クラスタ上で動いているサービスを⽌めない l ⼿作業で複雑なオペレーションをしない
簡単な⽅法 ▌サービスのバックエンドは冗⻑化されているので Pod を 1 個消しても動く ようになっている ▌ノード 1 を再起動(終わるまで待つ)
▌ノード 2 を再起動(終わるまで待つ) ▌… ▌⼿でやると永遠に終わらない
簡単な⽅法 ▌サービスのバックエンドは冗⻑化されているので Pod を 1 個消しても動く ようになっている ▌ノード 1 を再起動(終わるまで待つ)
▌ノード 2 を再起動(終わるまで待つ) ▌… ▌⼿でやると永遠に終わらない
簡単な⽅法 ▌サービスのバックエンドは冗⻑化されているので Pod を 1 個消しても動く ようになっている ▌ノード 1 を再起動(終わるまで待つ)
▌ノード 2 を再起動(終わるまで待つ) ▌… ▌⼿でやると永遠に終わらない
簡単な⽅法 ▌サービスのバックエンドは冗⻑化されているので Pod を 1 個消しても動く ようになっている ▌ノード 1 を再起動(終わるまで待つ)
▌ノード 2 を再起動(終わるまで待つ) ▌… ▌⼿でやると永遠に終わらない
実装した⽅法 ▌クラスタ管理ツール (CKE) に再起動待ちキューを実装する ▌「再起動待ちキューに全てのノードを追加するコマンド」を作る ▌トラブル発⽣時はアラートを発⽕させる l ⼈⼿で進捗を確認しなくてよい l コマンド⼊⼒後、⼈間が即座に解放される
Kubernetes クラスタ
その他注意点 ▌サービスを壊さないよう PodDisruptionBudget と Eviction API を 活⽤する l Pod
が Eviction できない場合は時間をおいてリトライする l ⼀定時間経つとアラートも鳴る ▌多少再起動に失敗したサーバーがあっても動作を続ける l アラートは鳴る ▌⼀時停⽌ボタンを付けておく
そもそもどうして⼀台ずつ再起動するのか ▌適当に複数台選ぶと運悪く特定 サービスの Pod が集中することが ある
そもそもどうして⼀台ずつ再起動するのか ▌適当に複数台選ぶと運悪く特定 サービスの Pod が集中することが ある ▌ノードをグループ分けしておき、 Pod に anti-affinity
を付けて 分散させる ▌ノード数が超多い時はこういった 対策をする必要がある