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
GKE Autopilotのコストを9000円/日から2000円/日へ!
Search
izumiiii
October 12, 2023
Programming
0
620
GKE Autopilotのコストを9000円/日から2000円/日へ!
izumiiii
October 12, 2023
Tweet
Share
More Decks by izumiiii
See All by izumiiii
CircleCIの実行時間を大幅に短縮した話
izumiiii
0
68
スタートアップが挑むクラウドネイティブなマルチリージョン戦略
izumiiii
0
140
Multi-cluster deployment using ArgoCD x Connect Gateway
izumiiii
0
230
Other Decks in Programming
See All in Programming
The Implementations of Advanced LR Parser Algorithm
junk0612
1
1.3k
七輪ライブラリー: Claude AI で作る Next.js アプリ
suneo3476
1
170
VitestのIn-Source Testingが便利
taro28
8
2.4k
The Evolution of the CRuby Build System
kateinoigakukun
1
760
ASP.NETアプリケーションのモダナイゼーションについて
tomokusaba
0
240
RubyKaigi Dev Meeting 2025
tenderlove
1
1.3k
Flutterでllama.cppをつかってローカルLLMを試してみた
sakuraidayo
0
120
Browser and UI #2 HTML/ARIA
ken7253
2
170
Serving TUIs over SSH with Go
caarlos0
0
540
Thank you <💅>, What's the Next?
ahoxa
1
590
Optimizing JRuby 10
headius
0
550
By the way Google Cloud Next 2025に行ってみてどうだった
ymd65536
0
110
Featured
See All Featured
Designing Experiences People Love
moore
142
24k
A Tale of Four Properties
chriscoyier
158
23k
4 Signs Your Business is Dying
shpigford
183
22k
The Invisible Side of Design
smashingmag
299
50k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.7k
Raft: Consensus for Rubyists
vanstee
137
6.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
Build your cross-platform service in a week with App Engine
jlugia
230
18k
Writing Fast Ruby
sferik
628
61k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Done Done
chrislema
184
16k
Transcript
GKE Autopilotのコストを9000円/日から2000円/日へ! 3-shake SRE Tech Talk #7
自己紹介 名前 Koizumi Fumiya Twitter izumiiii @izumiiii9 Blog https://izumiiii.com Zenn
https://zenn.dev/izumiiii 会社 株式会社Resilire 普段していること インフラ業務メインで、最近はよくKubernetesを触っています。
提供プロダクト Resilreの提供価値と機能 3 サプライチェーンリスク管理SaaS Resilire サプライチェーン全体(社内拠点や委託先、原料 調達先)をツリー上で構造的に管理。災害時、被 災影響の可能性がある拠点をマップ上で可視化・ リスト化。リストの拠点に自動でアンケート配信か ら回答結果のレポート生成を可能にするプロダク
トを提供しています。 3
突然ですが、Resilireではマルチクラスタで運用しています。 Tokyo Osaka
マルチクラスタによる費用がかかりすぎてる! 9000円/日
なんとかしないと!
Spot Pod for Autopilot vCPU, Memory当たり1/3程度の料金で使える。 注意点: 標準の Pod の実行でコンピューティングリソースが必要になると、GKE
に よって強制削除される場合がある。
出典: https://cloud.google.com/kubernetes-engine/pricing?hl=ja#autopilot_mode
apiVersion: apps/v1 kind: Deployment metadata: name: argocd-repo-server spec: template: spec:
containers: - name: argocd-repo-server nodeSelector: cloud.google.com/gke-spot: 'true' terminationGracePeriodSeconds: 25 設定例
リソースリクエスト Autopilotでのノードのインスタンスタイプ/ノード数は実際にクラスタにデプロイ されているPodに設定されたRequest量をもとに決定されている。 明示的にリソース量をマニフェストで指定していない場合、1コンテナあたり 0.5 vCPU, 2GiB Memoryが割り当てられる。
出典: https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-resource-r equests?hl=ja#compute-class-defaults
修正作業 • node数を確認する(kubectl get nodes) • 実態のメモリ使用状況を確認する(kubectl top pod) •
コードを修正する
修正作業② 実態に合わせてマニフェストを修正していく apiVersion: apps/v1 kind: Deployment metadata: name: argocd-repo-server spec:
template: spec: containers: - name: argocd-repo-server resources: requests: cpu: 250m memory: 512Mi
注意点 Autopilotでは1Podあたり最低 CPU: 250m メモリ: 0.5 GiB を割り当てないといけない。 それより小さい値を指定していても、値が変わらないようになっている。
対応した結果...
2000/日まで減らすことに成功!
まとめ • 開発初期段階から節約対策できるようにしましょう。 • Spot Pod for Autopilot、リソースリクエストも思ったより簡単に導入することができた。 • リソースリクエストは最低設定値が決まってるので気おつけよう。
ご清聴ありがとうございました。