Aks Cost Optimization
MicrosoftOfficialCreated by Microsoft
- Skill
- Research and analysis
- Cloud and DevOps
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured workflow for analyzing advanced cost efficiency in Azure Kubernetes Service (AKS) clusters. It focuses on technical placement and scheduling factors rather than high-level financial reporting. The skill guides users through evaluating Node Auto-Provisioning (NAP) readiness, bin-packing efficiency, node scaling bottlenecks, and storage costs. It is designed to be used for specific technical investigations, requiring the user to route broader cost or incident-related queries to their respective specialized skills.
What it does
- Evaluates cluster bin-packing efficiency and identifies consolidation candidates.
- Assesses readiness for adopting Node Auto-Provisioning (NAP).
- Identifies root causes for node scaling bottlenecks and blocked scale-down events.
- Analyzes storage cost and mapping configurations.
- Provides evidence-based recommendations for pool adjustments or placement changes.
- Requires explicit user approval before any cluster configuration changes.
When to use it
- When investigating inefficient resource utilization or poor bin-packing in an AKS cluster.
- When evaluating whether to migrate from fixed node pools or Cluster Autoscaler to NAP.
- When troubleshooting persistent node scaling bottlenecks or blocked scale-down operations.
- When analyzing storage-related costs within an AKS environment.
Advantages
- Provides deep technical insights into scheduling and placement constraints.
- Prevents conflicting recommendations by routing to specialized skills for financial or incident data.
- Ensures safe operations by requiring manual approval for all proposed changes.
- Uses standardized evidence collection for consistent analysis across clusters.
Usage examples
- “Analyze why my AKS cluster is failing to scale down nodes.”
- The agent will investigate blocked scale-down events, check for PDBs or disruption budgets, and identify if the nodes are managed by NAP or CAS to provide a resolution path.
- “Is my cluster ready for Node Auto-Provisioning?”
- The agent will perform an eligibility check, verify current networking and identity configurations, and report if NAP is a viable and cost-effective alternative for your workload.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/microsoft/aks-cost-optimization/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip aks-cost-optimization.zip -d .agents/skills
Documentation by Microsoft
AKS Cost Optimization
When to Use This Skill
Use for advanced existing-cluster analysis requiring scheduling, placement, or
verified storage mapping. Route overall AKS cost assessments to
azure-kubernetes, spend/anomalies to cost-analysis, commitments to
cost-optimization, and incidents to aks-troubleshooting when those skills are available. When called from an overall assessment, return findings for its ranked report.
MCP Tools
Prefer fitting Azure MCP reads. Never invent tools or use az/kubectl
without approved shell access and a target-bound context.
Workflow/Steps
Bind the subscription, cluster, resource group, and kube context.
Route to NAP readiness, bin-packing, node-scaling bottlenecks, or storage optimization.
When invoked for AKS commitment context, use the commitment-demand handoff and return demand evidence without benefit analysis or a transaction.
Keep reads non-mutating; require approval for every change.
Error Handling
Missing capability: analyze supplied evidence or provide a collection plan; mark dependent cost or commitment results unavailable.
Evidence conflict: mark the conclusion unconfirmed.
Files
- ATTRIBUTION.mdAdded by AutoGineer989 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md1.8 KiB
- references/aks-bin-packing.md3.8 KiB
- references/aks-nap.md3.2 KiB
- references/aks-savings-plans-reservations.md3.5 KiB
- references/aks-storage-optimization.md3.5 KiB
- references/bin-packing-evidence.md3.8 KiB
- references/nap-decisions.md3.3 KiB
- references/nap-enablement-and-rollback.md1.8 KiB
- references/nap-evidence-collection.md3.9 KiB
- references/node-scaling-bottlenecks.md3.8 KiB
- references/self-hosted-karpenter-migration.md2.1 KiB
- references/storage-container-insights.md2.9 KiB
- references/storage-decisions.md3.3 KiB
- references/storage-metrics.md3.7 KiB
references/aks-bin-packing.md
AKS Bin-Packing and Placement Optimization
Find safe node and placement consolidation candidates without claiming scheduler equivalence or a guaranteed minimum. Require approval before placement changes, pool resize/deletion, or drains.
Evidence
Collect and validate the bounded inputs in bin-packing evidence before assessment. Do not model incomplete evidence.
Assess
Calculate each node's allocatable CPU, memory, and pod slots; subtract the effective requests of all scheduled pods, including DaemonSet pods and pod overhead, counting each resource once. Report actual usage separately: requests determine scheduler fit, while history identifies candidates for the azure-kubernetes rightsizing workflow when that skill is available.
Model Scenarios
For each compatible target pool or SKU, calculate a theoretical minimum node count from scheduled workloads and confirmed eligible persistent pending demand:
max(
ceil(total CPU requests / allocatable CPU per node),
ceil(total memory requests / allocatable memory per node),
ceil(total pods / available pod slots per node)
)Calculate each required zone/placement partition separately, including per-node overhead, replicas, and operational headroom. Verify largest-pod fit and eligible nodes for required constraints. Reject blocked scenarios; otherwise require staged validation and do not claim the theoretical minimum is achievable or optimal.
For an owner-approved placement change, compare the baseline with one relaxed alternative, such as DoNotSchedule to ScheduleAnyway, required to preferred anti-affinity, or a corrected taint/toleration. Report eligible nodes/domains and excluded capacity before and after; verify replicas, SLOs, isolation, and compliance.
For a pool associated with a Capacity Reservation Group, retrieve the reserved VM size, region, zone, quantity, associated instances, unused quantity, and surge requirement. Verify that the proposed SKU, zone, node count, and migration or upgrade surge fit the reservation. Disclose capacity that would remain billable but unused, or a required CRG change, before recommending consolidation.
Recommend in this order:
Route oversized requests to rightsizing using historical evidence.
Recommend removing or relaxing a selector, taint, topology-spread constraint, or required affinity/anti-affinity rule only when its owner confirms the original placement, isolation, and availability requirement no longer applies.
Merge compatible pools or adjust VM shape while preserving failure-domain and performance requirements.
For idle nodes, identify the manager:
karpenter.sh/nodepoolmeans NAP; otherwise a matching agent pool withenableAutoScaling: truemeans CAS; neither means fixed capacity. For CAS nodes, invokeazure-kubernetesfor tuning when available. For NAP nodes, inspect the owningNodePool'sconsolidationPolicy,consolidateAfter, disruption budgets, PDBs, andkarpenter.sh/do-not-disruptblockers. Report fixed nodes as unmanaged and evaluate each manager separately in mixed clusters. Use NAP readiness only for NAP adoption or migration decisions.
Do not recommend a VM solely for its CPU:memory ratio. For candidate SKUs, verify largest-pod fit, architecture, disk/network capabilities, regional availability, quota, and workload performance.
Proposed Changes
Present constraints, causal evidence, cost consequence, proposed changes, CRG impact, rollback, and confidence. Require approval before placement/pool changes, cordon, drain, or scaling. Validate scheduling, SLOs, and zone coverage after each workload-, pool-, or node-scoped stage before proceeding. Scale down through the identified manager, or approved AKS pool resizing for fixed capacity; never delete nodes directly.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Node.js
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Microsoft
- Publisher
- Microsoft (Official)
- Source
- microsoft/skills · .github/plugins/aks-skills/skills/aks-cost-optimization · commit 0696600
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from .github/plugins/aks-skills/LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Microsoft or Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download aks-cost-optimization.zip