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
380
GKE Autopilotのコストを9000円/日から2000円/日へ!
izumiiii
October 12, 2023
Tweet
Share
More Decks by izumiiii
See All by izumiiii
CircleCIの実行時間を大幅に短縮した話
izumiiii
0
34
スタートアップが挑むクラウドネイティブなマルチリージョン戦略
izumiiii
0
83
Multi-cluster deployment using ArgoCD x Connect Gateway
izumiiii
0
190
Other Decks in Programming
See All in Programming
Composing an API the *right* way (Droidcon Berlin 2024)
zsmb
1
450
入社1ヶ月でここまでやった!Findy Toolsインフラ支援の最適化
rvirus0817
6
1.4k
Play Billing Library 7.0.0 変更点まとめ@potatotips#88
kako351
0
160
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Berlin
prof18
0
110
Microservices rules (July 2024) : what good looks like
cer
PRO
0
1.6k
Javaの現状2024夏 / Java current status 2024 summer
kishida
4
1.4k
CSC307 Lecture 13
javiergs
PRO
0
150
CSC307 Lecture 14
javiergs
PRO
0
220
Advanced App Shrinking Techniques
cbeyls
2
150
20240706_CDKConf
takuyay0ne
0
1.2k
【Go言語】golangci-lintの使い方
tomo1227
0
270
12年前の『型システム入門』翻訳の思い出話
mame
11
1.2k
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
245
1.2M
A Tale of Four Properties
chriscoyier
155
22k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
90
47k
Building Flexible Design Systems
yeseniaperezcruz
323
37k
5 minutes of I Can Smell Your CMS
philhawksworth
200
19k
Producing Creativity
orderedlist
PRO
340
39k
Principles of Awesome APIs and How to Build Them.
keavy
124
16k
Large-scale JavaScript Application Architecture
addyosmani
506
110k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
248
20k
Gamification - CAS2011
davidbonilla
78
4.9k
Build your cross-platform service in a week with App Engine
jlugia
227
17k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
35
6.3k
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、リソースリクエストも思ったより簡単に導入することができた。 • リソースリクエストは最低設定値が決まってるので気おつけよう。
ご清聴ありがとうございました。