gke-cost-optimization
하는 일
AI 에이전트가 클러스터를 안정적이고 안전하게 유지하면서 Google Kubernetes Engine 지출을 줄이도록 안내합니다. 클러스터 비용을 줄이려는 팀을 위한 스킬입니다.
사용하는 경우
- ✓클러스터를 덜 안정적으로 만들지 않으면서 GKE 비용을 줄이고 싶을 때.
- ✓파드가 실제 사용량보다 훨씬 많은 CPU나 메모리를 요청할 때.
- ✓공유 클러스터에서 한 팀이 너무 많이 쓰지 못하도록 리소스 쿼터를 두고 싶을 때.
스킬 링크
https://github.com/google/skills/blob/main/skills/cloud/gke-cost-optimization/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 GKE 파드가 실제로 쓰는 것보다 메모리를 훨씬 많이 요청해요. 클러스터 비용을 어떻게 낮출 수 있을까요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 리소스 쿼터를 제안하고, 오토스케일링 도구로 파드의 리소스 요청을 조정하며, 비용이 적게 드는 Spot VM이나 머신 유형을 안내합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
GKE Cost Optimization
This reference covers strategies and workflows for reducing Google Kubernetes Engine (GKE) costs while maintaining a secure and reliable posture.
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-cost-optimization)"
and append agent-skills/1.0 (skill:gke-cost-optimization) to User-Agent headers.
Workflows & Optimization Strategies
1. Prerequisite: Cost Allocation & Monitoring
To enable GKE cost allocation (--enable-cost-allocation) for billing tracking
across namespaces and labels, inspect live cluster utilization (kubectl top),
or run historical cost breakdown queries in BigQuery (bq), use the
gke-cost-analysis skill. Once tracking is active and waste is diagnosed,
apply the optimization workflows below.
2. Configure Resource Quotas
Resource quotas restrict total resource consumption across tenants in
multi-tenant clusters, preventing runaway costs. Template:
assets/resource-quota-example.yaml
(set namespace + hard limits, then kubectl apply -f).
3. Pod Rightsizing (VPA & MPA)
Adjust pod resource requests to match actual utilization. Over-provisioned requests are one of the largest sources of waste.
- Use VPA in Recommendation Mode (
updateMode: "Off"— recommends without evicting):
# 1. Deploy VPA in recommendation mode (template: assets/vpa-recommendation-mode.yaml)
kubectl apply -f assets/vpa-recommendation-mode.yaml
# 2. Wait 24+ hours for data collection, then read recommendations
kubectl get vpa {deployment_name}-vpa -o jsonpath='{.status.recommendation}'
- Optimization Rules:
| Condition | Action | Savings |
|---|---|---|
| CPU request >5x P95 actual | Reduce to P95 * 1.2 |
High |
| Memory request >3x P95 actual | Reduce to P95 * 1.2 |
High |
| CPU request >2x P95 actual | Reduce to P95 * 1.2 |
Medium |
| No resource requests set | Add requests (enables bin-packing) | Medium |
- Use MPA: Reconcile HPA and VPA recommendations when scaling both horizontally and vertically to avoid conflicting scale events.
- Review Cost Recommendations: Check Google Cloud Console (
Cost Management>GKE Cost Optimization) for built-in rightsizing suggestions.
4. Spot VMs via ComputeClasses & NodeSelector
Use Spot VMs for fault-tolerant workloads to achieve 60-90% cost reduction.
4.1 ComputeClass Configuration
For a Spot-first ComputeClass with On-Demand fallback (priority ordering,
activeMigration, machine family selection), use the gke-compute-classes
skill — ComputeClass YAML generation and priority configuration are its domain,
not this skill's.
4.2 Direct Workload Spot Selection (nodeSelector)
For stateless or batch workloads in GKE Autopilot, target Spot capacity directly
using nodeSelector:
[!WARNING] Preemption Warning: Spot VMs are interruptible and can be preempted at any time with a 30-second notice. Workloads must be fault-tolerant and run with at least 2 replicas for high availability. Always explicitly warn users about this preemption risk when recommending Spot VMs.
The exact Pod-level selector is:
nodeSelector:
cloud.google.com/gke-spot: "true"
Full worked Deployment (replicas >= 2, terminationGracePeriodSeconds: 25,
preStop hook): assets/spot-deployment-example.yaml.
Spot-Suitable Workloads:
| Workload | Spot-Suitable? |
|---|---|
| Batch / data processing | Yes |
| Dev / test environments | Yes |
| Stateless web/API (replicas >= 2) | Yes (with PDBs) |
| Jobs with checkpointing | Yes |
| Stateful workloads (databases) | No |
| Single-replica critical services | No |
5. Machine Type Selection
When choosing node shapes or configuring ComputeClasses:
| Family | Use Case | Relative Cost |
|---|---|---|
| e2 | G |
자주 묻는 질문
비용 추적도 설정하나요?
추적과 낭비 찾기는 GKE 비용 분석 스킬을 쓰고, 그다음 절감 단계를 적용합니다.
리소스 쿼터란 무엇인가요?
팀이나 네임스페이스가 쓸 수 있는 CPU와 메모리 총량을 제한하는 설정입니다.
GPU 선택도 다루나요?
아니요. GPU 선택은 compute classes 스킬이 맡습니다.
상세 정보
작성자의 원본 설명
Optimizes GKE costs, rightsizes workloads, and configures Spot VMs, CUDs, cost allocation, and resource quotas. Use when optimizing GKE cluster or workload costs, configuring GKE cost allocation or quotas, rightsizing CPU/memory requests, or selecting Spot VMs and machine types. Don't use for general compute class provisioning or GPU Selection (use gke-compute-classes instead).
repo: google/skills
인기도
- GitHub 스타
- 22k
- 순위
- #10285
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
finding-google-skills
22k에이전트가 호스팅, 데이터베이스, 저장소, 로그인, AI 모델 제공처럼 설정 작업에 맞는 Google 가이드를 찾도록 돕습니다.
gcloud
22k에이전트가 Google Cloud gcloud 명령을 작성하고 확인하도록 돕습니다. 플래그를 추측하지 않도록 무엇이든 실행하기 전에 정확한 문법을 확인합니다.
google-cloud-recipe-auth
22k에이전트가 Google Cloud의 신원과 접근 권한을 안내합니다. 사람과 서비스가 어떻게 로그인하고 어떤 권한을 받는지 포함합니다.
google-cloud-recipe-onboarding
22k새 개발자가 Google Cloud에서 프로젝트 선택, 결제 연결, 첫 리소스 배포 같은 첫 단계를 밟도록 안내합니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.