Note
このレポジトリは、Google Cloud Next Tokyo 2026 のカスタマーセッション「実践 FinOps の全手法 ー 大型ゲームタイトルのコスト大幅削減への道」のデモ用に作成されたものです。
This repository contains the demo used in the customer session "FinOps in Practice: A Complete Guide to Achieving Significant Cost Reductions for Large-Scale Game Titles" at Google Cloud Next Tokyo 2026.
komputer is a small CLI for comparing GCE spot machine prices and GKE
capacity recommendation scores, then generating a GKE ComputeClass patch.
The current built-in spot SKU catalog is focused on asia-northeast1.
- Go 1.25 or newer
- Google Cloud Application Default Credentials
- A GCP project that can call the Cloud Billing Catalog API and Compute capacity recommendation API
Authenticate locally:
gcloud auth application-default logingo run . list-spot-prices \
--project my-gcp-project \
--region asia-northeast1 \
--core-needs 100This prints the spot unit prices followed by machine types sorted by price per core, including capacity recommendation data for the requested core count.
Constrain the capacity checks to specific zones:
go run . list-spot-prices \
--project my-gcp-project \
--region asia-northeast1 \
--core-needs 100 \
--zones asia-northeast1-a,asia-northeast1-bgo run . capacity-recommendation n4-standard-32 \
--project my-gcp-project \
--region asia-northeast1 \
--instance-count 4Constrain the recommendation to specific zones:
go run . capacity-recommendation n4-standard-32 \
--project my-gcp-project \
--region asia-northeast1 \
--instance-count 4 \
--zones asia-northeast1-a,asia-northeast1-bGenerate priorities from all known machine types:
go run . gen-computeclass \
--project my-gcp-project \
--region asia-northeast1 \
--name generated-spot \
--core-needs 100 \
--obtain-score-threshold 0.5 \
--uptime-score-threshold 0.5 \
> computeclass-patch.yamlLimit the candidates and constrain capacity checks to specific zones:
go run . gen-computeclass \
--project my-gcp-project \
--region asia-northeast1 \
--name generated-spot \
--core-needs 128 \
--candidates n4-standard-32,c4-standard-48,c3d-standard-60 \
--zones asia-northeast1-a,asia-northeast1-b \
--obtain-score-threshold 0.7 \
--uptime-score-threshold 0.7 \
> computeclass-patch.yamlExample output:
apiVersion: cloud.google.com/v1
kind: ComputeClass
metadata:
name: generated-spot
spec:
priorities:
- machineType: n4-standard-32
spot: true
- machineType: c4-standard-48
spot: trueThe generated manifest is intentionally minimal. It is meant to be combined
with a base ComputeClass manifest by kustomize.
GOCACHE=/private/tmp/komputer-go-build-cache go test ./...