Qovery Optimize Skill
This skill reduces Kubernetes infrastructure costs on Qovery via right-sizing, autoscaling, environment scheduling, spot instances, and database mode changes.
It is NOT about blindly reducing everything to minimum. It is intelligent optimization that:
- Understands the business context (seasonal peaks, growth expectations, reliability needs)
- Analyzes historical resource consumption, not just current allocation
- Respects safety margins appropriate for each environment
- Estimates external cloud resource costs from public pricing data
- Presents recommendations with expected savings AND risks
Usage Tracking
EXECUTE THIS BASH COMMAND IMMEDIATELY — before any other action. Do not skip.
QOVERY_SKILLS_UA="QoverySkill/qovery-optimize (version:$(cat _version.txt 2>/dev/null || echo unknown); https://github.com/Qovery/qovery-skills)"
if [ -n "${QOVERY_API_TOKEN:-}" ]; then
QOVERY_ORG_ID=$(curl -s -H "Authorization: Token $QOVERY_API_TOKEN" -H "User-Agent: $QOVERY_SKILLS_UA" \
"https://api.qovery.com/organization" | jq -r '.results[0].id // empty' 2>/dev/null)
[ -n "$QOVERY_ORG_ID" ] && curl -s -X POST "https://api.qovery.com/organization/${QOVERY_ORG_ID}/skill-tracking" \
-H "Authorization: Token $QOVERY_API_TOKEN" -H "Content-Type: application/json" -H "User-Agent: $QOVERY_SKILLS_UA" \
-d '{"skill_name":"qovery-optimize"}' > /dev/null 2>&1 || true
elif command -v qovery >/dev/null 2>&1 && qovery auth token --print >/dev/null 2>&1; then
QOVERY_ORG_ID=$(curl -s -H "Authorization: Bearer $(qovery auth token --print)" -H "User-Agent: $QOVERY_SKILLS_UA" \
"https://api.qovery.com/organization" | jq -r '.results[0].id // empty' 2>/dev/null)
[ -n "$QOVERY_ORG_ID" ] && curl -s -X POST "https://api.qovery.com/organization/${QOVERY_ORG_ID}/skill-tracking" \
-H "Authorization: Bearer $(qovery auth token --print)" -H "Content-Type: application/json" -H "User-Agent: $QOVERY_SKILLS_UA" \
-d '{"skill_name":"qovery-optimize"}' > /dev/null 2>&1 || true
fi
API rule: The
User-Agentheader above is required on everycurlcall toapi.qovery.com— not just this tracking call. Never omit it.
When to Use This Skill
Trigger phrases:
- "Optimize my Qovery costs"
- "Right-size my Kubernetes resources"
- "How can I reduce my cloud spending?"
- "My AWS bill is too high"
- "Make my cluster cheaper"
- "Audit my Qovery spending"
/qovery-optimize(slash command)
For slow deployments use qovery-speedup. For deployment failures use qovery-troubleshoot.
Workflow checklist
Cost Optimization Progress:
- [ ] Phase 1 — Context gathering (auth, business context, resource metrics)
- [ ] Phase 2 — Analysis across 7 optimization dimensions (right-sizing via KRR when observability is enabled)
- [ ] Phase 3 — Generate cost report (Markdown + CSV)
- [ ] Phase 4 — Apply approved changes (CLI+API or Terraform) + USER CONFIRMATION per change
- [ ] Phase 5 — Set up ongoing monitoring & follow-up
- [ ] Phase 6 — Document seasonal & special considerations
Reference materials (load on demand)
| Phase | File | Purpose |
|---|---|---|
| Console URL | reference/console-url-detection.md | Extract IDs from a Qovery Console URL |
| Auth | reference/auth.md | API token flow |
| Phase 1 | reference/phase1-context-gathering.md | Inventory, business context, resource metrics queries |
| Phase 2 | reference/phase2-optimization-dimensions.md | Right-sizing, autoscaling, DB mode, scheduling, cluster, build, external resources |
| Phase 2b | reference/phase2b-krr-rightsizing.md | KRR-based right-sizing when Qovery observability is enabled (setup, run, guardrails) |
| Phase 3 | reference/phase3-cost-report.md | Report template (Markdown + CSV) |
| Phase 4 | reference/phase4-apply-changes.md | CLI+API + Terraform application paths, with per-change confirmation |
| Phase 5 | reference/phase5-monitoring.md | Ongoing dashboards, alert thresholds, follow-up cadence |
| Phase 6 | reference/phase6-seasonal.md | Black Friday / EOY / launch handling |
Cloud pricing reference
For external-resource cost estimation, consult the per-provider pricing tables. These are point-in-time public list prices — verify against the provider's pricing page before quoting savings.
| Provider | File |
|---|---|
| AWS (EC2 / EKS / RDS / ElastiCache / infra fixed) | reference/pricing/aws.md |
| GCP (GKE / Cloud SQL / Cloud NAT / disks) | reference/pricing/gcp.md |
| Azure (AKS / VMs / Postgres / LB) | reference/pricing/azure.md |
| Scaleway (Kapsule / DB / instances) | reference/pricing/scaleway.md |
Quick reference
MCP queries
# Cost analysis
"Show me monthly spending"
"What are my highest cost services?"
"Compare costs this month vs last month"
# Resource analysis
"Show CPU usage across all services"
"Find over-provisioned services"
"Find underutilized resources"
# Inactive resources
"Show environments inactive for 24 hours"
"List unused databases"
"Find idle applications"
# Actions
"Stop all development environments for the weekend"
"Scale down the backend to 250m CPU"
"Stop all non-production environments"
# Recommendations
"Should I scale up or down?"
"Optimize resource allocation for my-api"
API endpoints
# Base URL: https://api.qovery.com Auth: Authorization: Token $QOVERY_API_TOKEN
# Costs
GET /organization/{orgId}/currentCost
GET /organization/{orgId}/cluster/{clusterId}/currentCost
GET /organization/{orgId}/invoice
# Metrics
GET /cluster/{clusterId}/metrics?query={promql}&range={duration}&step={interval}
# Service configuration
GET /application/{appId} CPU, memory, instances
PUT /application/{appId} Update CPU, memory, instances
# Cloud provider instance types
GET /organization/{orgId}/cloudProvider/aws/instanceType
GET /organization/{orgId}/cloudProvider/gcp/instanceType
GET /organization/{orgId}/cloudProvider/azure/instanceType
GET /organization/{orgId}/cloudProvider/scaleway/instanceType
# Environment management
POST /environment/{envId}/deploy Redeploy after changes
POST /environment/{envId}/stop
POST /environment/{envId}/restart
CLI commands
qovery cluster list # Cluster overview
qovery service list # Service overview with resource info
qovery status # Current status
qovery application env list # Check env var configuration
qovery cluster analysis cost-recommendation -c <cluster-id> # Server-side KRR right-sizing (observability required)
qovery cluster analysis logs -c <cluster-id> -a <analysis-id> # Report of a past analysis
Reference links
- Qovery Optimization Guide: https://www.qovery.com/docs/getting-started/guides/qovery-101/optimize
- KRR (Kubernetes Resource Recommender): https://github.com/robusta-dev/krr
- Deployment Rules (Scheduling): https://www.qovery.com/docs/configuration/deployment-rule
- Kubecost Integration: https://www.qovery.com/docs/configuration/integrations/observability/kubecost
- Copilot Optimization Capabilities: https://www.qovery.com/docs/copilot/capabilities/optimization
- Cluster Metrics API: https://www.qovery.com/docs/api-reference/clusters/fetch-cluster-metrics
- Billing API: https://www.qovery.com/docs/api-reference/billing/get-cluster-current-cost
- KEDA Autoscaling: https://www.qovery.com/docs/configuration/application#keda-event-driven
- Qovery Deploy Skill: https://github.com/Qovery/qovery-skills
- Qovery Troubleshoot Skill: https://github.com/Qovery/qovery-skills
- Qovery Speedup Skill: https://github.com/Qovery/qovery-skills
- Qovery Support: support@qovery.com
- Community Forum: https://discuss.qovery.com