AGENTIC MEMORY

Skills

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

← Back to Skills

azure-kubernetes

Plan, create, and configure production-ready Azure Kubernetes Service (AKS) clusters. Covers Day-0 checklist, SKU selection (Automatic vs Standard), networking options (private API server, Azure CNI Overlay, egress configuration), security, and operations (autoscaling, upgrade strategy, cost analysis). WHEN: create AKS environment, provision AKS, enable AKS observability, design AKS networking, choose AKS SKU, secure AKS, optimize AKS, AKS spot nodes, AKS cluster-autoscaler, rightsize AKS pod, pod rightsizing, over-provisioned AKS pod, pod resource requests and limits, Vertical Pod Autoscaler, VPA recommendations.

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--azure-kubernetes 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 · 8

references/azure-aks-autoscaler.md

AKS Cluster Autoscaler (CAS)

Enable and tune the Cluster Autoscaler to automatically scale down idle nodes.

Check CAS Status

az aks show \
  --name "<CLUSTER_NAME>" --resource-group "<RESOURCE_GROUP>" \
  --query "agentPoolProfiles[].{name:name, casEnabled:enableAutoScaling, min:minCount, max:maxCount, count:count}" \
  -o table

az aks show \
  --name "<CLUSTER_NAME>" --resource-group "<RESOURCE_GROUP>" \
  --query "autoScalerProfile" -o json

Check Node Utilization (7 days)

Follow the metrics discovery steps in azure-aks-rightsizing.md to list available metric definitions and query node CPU utilization. Use metric names such as node_cpu_usage_percentage or cpuUsagePercentage depending on what's available on the cluster.

Enable CAS

# Cluster-level
az aks update \
  --name "<CLUSTER_NAME>" --resource-group "<RESOURCE_GROUP>" \
  --enable-cluster-autoscaler \
  --min-count <MIN_NODES> --max-count <MAX_NODES>

# Specific node pool
az aks nodepool update \
  --cluster-name "<CLUSTER_NAME>" --resource-group "<RESOURCE_GROUP>" \
  --name "<NODEPOOL_NAME>" \
  --enable-cluster-autoscaler \
  --min-count <MIN_NODES> --max-count <MAX_NODES>

Recommended min/max Defaults

| Scenario | min-count | max-count | |----------|-----------|-----------| | Dev/test | 1 | current_count | | Production (web/API) | 2 | current_count * 3 | | Production (batch) | 0 | current_count * 5 |

Risk: Low. CAS only scales down when pods can be safely rescheduled. Set min-count >= 2 for production HA.

Tune CAS Profile

Apply when CAS is already on but idle nodes persist. The following cost-oriented profile is an example, not a universal default. The two scale-down timers are shorter than their documented 10-minute defaults, while the utilization threshold remains at its 0.5 default:

az aks update \
  --name "<CLUSTER_NAME>" --resource-group "<RESOURCE_GROUP>" \
  --cluster-autoscaler-profile \
    scale-down-delay-after-add=5m \
    scale-down-unneeded-time=5m \
    scale-down-utilization-threshold=0.5 \
    max-graceful-termination-sec=600

Risk: Medium. Shorter scale-down timers can reduce idle cost, but they can also cause node reprovisioning after brief demand changes. This thrashing adds provisioning latency; use a less aggressive profile for workloads with frequent short scale-out and scale-in cycles. See AKS cluster autoscaler profile settings and aggressive scale-down guidance.

Keep skip-nodes-with-system-pods at its default true. It prevents scale-down of nodes that host non-DaemonSet kube-system pods. Do not use skip-nodes-with-system-pods=false as a cost lever or assume every Microsoft-managed system component can be protected by a customer-managed PDB. See AKS support policies.

To roll back to CAS defaults:

az aks update \
  --name "<CLUSTER_NAME>" --resource-group "<RESOURCE_GROUP>" \
  --cluster-autoscaler-profile ""

Profile Comparison

| Profile | scale-down-delay-after-add | scale-down-unneeded-time | utilization-threshold | Best For | |---------|----------------------------|--------------------------|----------------------|----------| | Default | 10m | 10m | 0.5 | General workloads | | Cost-Optimized | 5m | 5m | 0.5 | Cost-sensitive, non-critical | | Conservative | 30m | 30m | 0.7 | Stateful / production | | Aggressive | 2m | 2m | 0.4 | Dev/test, batch |

Risk: High for aggressive tuning. Ensure PodDisruptionBudgets (PDBs) are set on critical workloads before tuning. Always confirm with user before applying.

Check existing PDBs before tuning:

kubectl get pdb --all-namespaces