AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

aks-cost-optimization

Analyze advanced AKS cost efficiency. WHEN: "AKS NAP readiness", "AKS bin packing", "AKS node scaling bottleneck", "AKS blocked scale-down", "AKS storage cost". DO NOT USE AS DIRECT ENTRY FOR: overall AKS cost assessments or rightsizing/VPA/CAS/Spot (azure-kubernetes); spend/anomalies/commitments (cost-analysis/cost-optimization); incidents (aks-troubleshooting).

Original source
microsoft
License
MIT
Pinned revision
3f5b461b2314e01c400564051e92469114c5b68f

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read microsoft--aks-cost-optimization at revision 3f5b461b2314e01c400564051e92469114c5b68f, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 14

references/storage-container-insights.md

Container Insights PVC Capacity History

Use for one verified PVC/PV mapping. Reuse the cluster ID, namespace, PVC, and PV verified by the storage workflow. Use the requested UTC window (maximum 30 days), otherwise the last 30 days. Limit it to the verified current binding and available history, with start < stop. Report actual boundaries.

Summarize usage and inventory separately, then join by namespace/PVC within the target cluster, not collection time. Aggregate usage per minute before p95 to avoid weighting by pod count.

let start = datetime(<assessment-start-utc>);
let stop = datetime(<end-utc>);
let cluster = "<aks-resource-id>";
let ns = "<namespace>";
let claim = "<pvc>";
let expectedPV = "<verified-pv>";
let inventory = KubePVInventory
| where TimeGenerated >= start and TimeGenerated < stop
| where ClusterId =~ cluster and PVCNamespace == ns and PVCName == claim
| summarize inventoryRows=count(),
    conflictingRows=countif(PVName != expectedPV or PVStatus != "Bound"),
    firstInventory=min(TimeGenerated), lastInventory=max(TimeGenerated)
| extend PVCNamespace=ns, PVCName=claim;
let usage = InsightsMetrics
| where TimeGenerated >= start and TimeGenerated < stop
| where Namespace == "container.azm.ms/pv" and Name == "pvUsedBytes"
| extend t=todynamic(Tags)
| where tostring(t.clusterId) =~ cluster
    and tostring(t.pvcNamespace) == ns and tostring(t.pvcName) == claim
| summarize usedBytes=max(Val),
    firstSample=min(TimeGenerated), lastSample=max(TimeGenerated)
    by bucket=bin(TimeGenerated, 1m)
| summarize usageBuckets=count(),
    firstSample=min(firstSample), lastSample=max(lastSample),
    p95ObservedBytes=percentile(usedBytes, 95),
    maxObservedBytes=max(usedBytes)
| extend PVCNamespace=ns, PVCName=claim;
usage
| join kind=leftouter inventory on PVCNamespace, PVCName
| extend bindingMatches=inventoryRows > 0 and conflictingRows == 0

Zero usage buckets means unavailable, never zero utilization. Before attributing history to the current PV or rightsizing, require bindingMatches and representative inventory/usage coverage.

Compare counts and first/last timestamps with the requested window and actual collection cadence and confirm relevant workload cycles are represented. Matching observations, counts, and endpoints cannot prove continuity or exclude same-name PVC recreation; these tables lack PVC UID. Inspect bounded source history or lifecycle evidence when needed.

Conflicts or unresolved gaps make attribution ambiguous. If evidence establishes a narrower current-binding period, rerun once for that window. If binding or coverage remains uncertain, report insufficient evidence.

If collection is slower than one minute, adjust the usage bucket to that cadence and report it. Use verified positive current capacity for explicitly labeled current-capacity ratios, not historical utilization percentages. Retain growth/recovery headroom.