Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GKE Autopilotのコストを9000円/日から2000円/日へ!
Search
izumiiii
October 12, 2023
Programming
870
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GKE Autopilotのコストを9000円/日から2000円/日へ!
izumiiii
October 12, 2023
Transcript
18 slides
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、リソースリクエストも思ったより簡単に導入することができた。 • リソースリクエストは最低設定値が決まってるので気おつけよう。
ご清聴ありがとうございました。
More Decks by izumiiii
See All by izumiiii
CircleCIの実行時間を大幅に短縮した話
izumiiii
0
130
スタートアップが挑むクラウドネイティブなマルチリージョン戦略
izumiiii
0
240
Multi-cluster deployment using ArgoCD x Connect Gateway
izumiiii
0
330
Other Decks in Programming
See All in Programming
AI Augmentation Techniques with Liberty
ivargrimstad
1
470
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
130
はじめてのPLATEAU
nokonoko1203
1
650
SODA - FACT BOOK(EN)
sodainc
1
240
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
2.1k
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
200
Crash Auto Pipelines
veronikapj
1
410
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
210
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
310
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
330
LLM 101
dalinaum
0
490
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
460
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Paper Plane
katiecoart
PRO
6
55k
Git: the NoSQL Database
bkeepers
PRO
433
67k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Building Applications with DynamoDB
mza
96
7.3k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.7k
Side Projects
sachag
456
43k
A Modern Web Designer's Workflow
chriscoyier
699
190k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
330