Generated banner for Azure Kubernetes
Generated logo for Azure Kubernetes

Azure Kubernetes

MicrosoftOfficialCreated by Microsoft

  • Skill
  • Workflow
  • Cloud and DevOps
  • MIT
  • No issues found

From the author

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.
— the description by Microsoft

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a comprehensive framework for designing and managing Azure Kubernetes Service (AKS) clusters. It guides users through critical Day-0 architectural decisions—such as networking models, SKU selection, and security configurations—that are difficult to modify after deployment. The skill also covers ongoing operational tasks including observability, cost optimization, and upgrade strategies, ensuring clusters are built for production reliability and performance.

What it does

  • Assists in planning and provisioning new AKS clusters based on production requirements.
  • Provides guidance on choosing between AKS Automatic and Standard SKUs.
  • Configures networking, including pod IP models, ingress, egress, and network policies.
  • Implements security best practices like Microsoft Entra ID integration and secret management.
  • Sets up observability using Managed Prometheus, Container Insights, and Grafana.
  • Coordinates cost-optimization workflows including autoscaling, spot nodes, and pod rightsizing.

When to use it

  • When you need to create a new AKS cluster from scratch.
  • When designing the network architecture for a production-grade Kubernetes environment.
  • When you need to evaluate and implement security or observability standards for AKS.
  • When optimizing an existing cluster for cost, performance, or reliability.
  • When determining the appropriate upgrade and patching strategy for your infrastructure.

Advantages

  • Ensures critical Day-0 architectural decisions are made correctly to avoid future rework.
  • Provides a structured, authoritative approach to complex AKS configurations.
  • Integrates specialized workflows for cost management and resource rightsizing.
  • Promotes the use of modern, high-performance defaults like Azure CNI Overlay and Cilium.
  • Reduces operational risk by enforcing security and reliability best practices.

Usage examples

“I need to set up a new production AKS cluster in the East US region.”
The agent will initiate a consultation to gather requirements for networking, node sizing, and security, then provide a configuration plan based on the AKS Automatic SKU.
“How can I reduce the costs of my existing AKS cluster?”
The agent will perform a cost review, evaluating the use of spot node pools, cluster autoscaler tuning, and pod rightsizing recommendations.
“What is the best way to handle egress traffic for my AKS pods?”
The agent will explain options like Static Egress Gateway or UDR with Azure Firewall, helping you choose the best fit for your security and routing needs.
“Should I use Azure CNI Overlay or VNet-routable CNI?”
The agent will compare the two models based on your scale and connectivity requirements, recommending Azure CNI Overlay as the default for most modern workloads.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/microsoft/azure-kubernetes/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip azure-kubernetes.zip -d .agents/skills

Documentation by Microsoft

Azure Kubernetes Service

AUTHORITATIVE GUIDANCE — MANDATORY COMPLIANCE

This skill produces a recommended AKS cluster configuration based on user requirements, distinguishing Day-0 decisions (networking, API server — hard to change later) from Day-1 features (can enable post-creation). See CLI reference for commands.

Quick Reference

PropertyValue
Best forAKS cluster planning and Day-0 decisions
MCP Toolsmcp_azure_mcp_aks
CLIaz aks create, az aks show, kubectl get, kubectl describe
Related skillsazure-kubernetes-app-deploy (deploy an app to an existing cluster), azure-diagnostics (baseline AKS troubleshooting), azure-validate (readiness checks), azure-kubernetes-automatic-readiness (migrate existing cluster to AKS Automatic), optional aks-skills operations add-on (focused incident, advanced cost-efficiency, exact-signature, packet-capture, and GPU Day-2 workflows)

When to Use This Skill

Activate this skill when user wants to:

  • Create a new AKS cluster

  • Plan AKS cluster configuration for production workloads

  • Design AKS networking (API server access, pod IP model, egress)

  • Set up AKS identity and secrets management

  • Configure AKS governance (Azure Policy, Deployment Safeguards)

  • Enable AKS observability (Container Insights, Managed Prometheus, Grafana)

  • Define AKS upgrade and patching strategy

  • Understand AKS Automatic vs Standard SKU differences

  • Get a Day-0 checklist for AKS cluster setup and configuration

Deploying an application to an existing cluster? This skill provisions and configures the cluster. To containerize an app and deploy it to a cluster that already exists (Dockerfile + manifests + Deployment Safeguards), use the azure-kubernetes-app-deploy sub-skill instead.

Deeper operational task? Keep Day-0 planning and basic operations in this base skill. Load optional-aks-operations.md only when a focused optional AKS operational skill could improve the current task.

Rules

  1. Start with the user's requirements for provisioning compute, networking, security, and other settings.

  2. Use the azure MCP server and select mcp_azure_mcp_aks first to discover the exact AKS-specific MCP tools surfaced by the client. Choose the smallest discovered AKS tool that fits the task, and fall back to Azure CLI (az aks) only when the needed functionality is not exposed through the AKS MCP surface.

  3. Determine if AKS Automatic or Standard SKU is more appropriate based on the user's need for control vs convenience. Default to AKS Automatic unless specific customizations are required.

  4. Document decisions and rationale for cluster configuration choices, especially for Day-0 decisions that are hard to change later (networking, API server access).

Required Inputs (Ask only what’s needed)

If the user is unsure, use safe defaults.

  • AKS environment type: dev/test or production

  • Region(s), availability zones, preferred node VM sizes

  • Expected scale (node/cluster count, workload size)

  • Networking requirements (API server access, pod IP model, ingress/egress control)

  • Security and identity requirements, including image registry

  • Upgrade and observability preferences

  • Cost constraints

Workflow

1. Cluster Type
  • AKS Automatic (default): Best for most production workloads, provides a curated experience with pre-configured best practices for security, reliability, and performance. Use unless you have specific custom requirements for networking, autoscaling, or node pool configurations not supported by Node Auto-Provisioning (NAP).

  • AKS Standard: Use if you need full control over environment configuration, which requires additional overhead to set up and manage.

2. Networking (Pod IP, Egress, Ingress, Dataplane)

Pod IP Model (Key Day-0 decision):

  • Azure CNI Overlay (recommended): pod IPs from private overlay range, not VNet-routable, scales to large environments and good for most workloads

  • Azure CNI (VNet-routable): pod IPs directly from VNet (pod subnet or node subnet), use when pods must be directly addressable from VNet or on-prem

Dataplane & Network Policy:

  • Azure CNI powered by Cilium (recommended): eBPF-based for high-performance packet processing, network policies, and observability

Egress:

  • Static Egress Gateway for stable, predictable outbound IPs

  • For restricted egress: UDR + Azure Firewall or NVA

Ingress:

  • App Routing addon with Gateway API — recommended default for HTTP/HTTPS workloads

  • Istio service mesh with Gateway API - for advanced traffic management, mTLS, canary releases

  • Application Gateway for Containers — for L7 load balancing with WAF integration

DNS:

  • Enable LocalDNS on all node pools for reliable, performant DNS resolution

3. Security
  • Use Microsoft Entra ID everywhere (control plane, Workload Identity for pods, node access). Avoid static credentials.

  • Azure Key Vault via Secrets Store CSI Driver for secrets

  • Enable Azure Policy + Deployment Safeguards

  • Enable Encryption at rest for etcd/API server; in-transit for node-to-node

  • Allow only signed, policy-approved images (Azure Policy + Ratify), prefer Azure Container Registry

  • Isolation: Use namespaces, network policies, scoped logging

4. Observability
  • Use Managed Prometheus and Container Insights with Grafana for AKS observability (logs + metrics).

  • Enable Diagnostic Settings to collect control plane logs and audit logs in a Log Analytics workspace for security monitoring and troubleshooting.

  • For other monitoring and troubleshooting tools, use features like the Agentic CLI for AKS, Application Insights, Resource Health Center, AppLens detectors, and Azure Advisors.

5. Upgrades & Patching
  • Configure Maintenance Windows for controlled upgrade timing

  • Enable auto-upgrades for control plane and node OS to stay up-to-date with security patches and Kubernetes versions

  • Consider LTS versions for enterprise stability (2-year support) by upgrading your AKS environment to the Premium tier

  • Fleet upgrades: Use AKS Fleet Manager for staged rollout across test to production environments

6. Performance
  • Use Ephemeral OS disks (--node-osdisk-type Ephemeral) for faster node startup

  • Select Azure Linux as node OS (smaller footprint, faster boot)

  • Enable KEDA for event-driven autoscaling beyond HPA

7. Node Pools & Compute
  • Dedicated system node pool: At least 2 nodes, tainted for system workloads only (CriticalAddonsOnly)

  • Node Auto Provisioning (NAP) is enabled per cluster and can reduce cost when dynamic capacity fits workload demand; savings are not guaranteed. Enable NAP for new clusters. For existing clusters, use optional AKS operations to invoke aks-cost-optimization when available for NAP readiness. Otherwise, continue with base NAP readiness.

  • Use latest generation SKUs (v5/v6) for host-level optimizations

  • Avoid B-series VMs — burstable SKUs cause performance/reliability issues

  • Use SKUs with at least 4 vCPUs for production workloads

  • Set topology spread constraints to distribute pods across hosts/zones per SLO

8. Reliability
  • Deploy across 3 Availability Zones (--zones 1 2 3)

  • Use Standard tier for zone-redundant control plane + 99.95% SLA for API server availability

  • Enable Microsoft Defender for Containers for runtime protection

  • Configure PodDisruptionBudgets for all production workloads

  • Use topology spread constraints to ensure pod distribution across failure domains

9. Cost Controls
  • Use Spot node pools for batch/interruptible workloads (up to 90% savings)

  • Stop/Start dev/test clusters: az aks stop/start

Focused AKS Cost Workflows

For a focused request, load only the relevant reference file.

ScenarioTrigger KeywordsReference
Pod Rightsizingover-provisioned pods, CPU requests, memory requests, rightsize workloadsazure-aks-rightsizing.md
VPA Setupvertical pod autoscaler, VPA recommendations, VPA enableazure-aks-vpa.md
Cluster Autoscaleridle nodes, CAS off, enable autoscaler, scale-down profile, node utilizationazure-aks-autoscaler.md
Spot Node PoolsSpot VMs, Spot nodes, batch workloads, cheaper nodesazure-aks-spot.md
Advanced AKS Cost EfficiencyNAP readiness, node-pool bin packing, blocked scale-down, Kubernetes storage costoptional AKS operations

Disambiguation: If a prompt matches multiple rows (e.g., "cheaper nodes" could suggest both Spot and autoscaler), prefer the most specific match. If ambiguous, ask the user to clarify their intent before loading a reference file.

Comprehensive AKS Cost Review

When the user requests an overall AKS cost assessment rather than one focused workflow, this skill owns triage and coordinates one unified review:

  1. Confirm the target subscription, resource group, and AKS cluster. If cost-analysis is available, collect one billed-cost baseline for that scope and reuse it throughout the review.

  2. Evaluate the applicable rightsizing, VPA, Cluster Autoscaler, and Spot workflows.

  3. Invoke aks-cost-optimization when available for NAP readiness, node-pool bin packing, node-scaling bottlenecks, or Kubernetes-to-Azure storage optimization.

  4. Check for stable non-Spot demand. If present, invoke cost-optimization when available for commitment analysis. If the capability or evidence is unavailable, report commitment analysis as a gap. Do not recommend a purchase from this review alone.

Investigate applicable levers and return one ranked report. Rank by comparable estimated cost impact when available; keep unknown monetary impact unknown rather than zero. Do not present one narrow analysis as the complete review. Mark unavailable capabilities or evidence as gaps.

RankLeverEvidenceEstimated cost impact and basisRiskApproval neededConfidence

Guardrails / Safety

  • Do not request or output secrets (tokens, keys).

  • Do not ask the user to paste subscription IDs. Discover subscription and resource scope via MCP tools (e.g., list subscriptions, list resource groups) or az account show / az account list so the agent can resolve context without exposing identifiers.

  • If requirements are ambiguous for day-0 critical decisions, ask the user clarifying questions. For day-1 enabled features, propose 2–3 safe options with tradeoffs and choose a conservative default.

  • Do not promise zero downtime; advise workload safeguards (PDBs, probes, replicas) and staged upgrades along with best practices for reliability and performance.

MCP Tools

ToolPurposeKey Parameters
mcp_azure_mcp_aksAKS MCP entry point used to discover the exact AKS-specific tools exposed by the clientDiscover the callable AKS tool first, then use that tool's parameters

Error Handling

Error / SymptomLikely CauseRemediation
MCP tool call fails or times outInvalid credentials, subscription, or AKS contextVerify az login, confirm the active subscription context with az account show, and check the target resource group without echoing subscription identifiers back to the user
Quota exceededRegional vCPU or resource limitsRequest quota increase or select different region/VM SKU
Networking conflict (IP exhaustion)Pod subnet too small for overlay/CNIRe-plan IP ranges; may require cluster recreation (Day-0)
Workload Identity not workingMissing OIDC issuer or federated credentialEnable --enable-oidc-issuer --enable-workload-identity, configure federated identity

Files

references/azure-aks-rightsizing.md

AKS Pod Rightsizing

Identify pods requesting far more CPU/memory than they use and recommend reduced resource requests.

Prerequisites — Check Monitoring State First

Before collecting usage data, determine what monitoring is available on the cluster:

# 1. Check if Azure Managed Prometheus is enabled
az aks show \
  --name "<CLUSTER_NAME>" --resource-group "<RESOURCE_GROUP>" \
  --query "azureMonitorProfile.metrics.enabled" -o tsv

# 2. Check if Container Insights (Log Analytics) is enabled
az aks show \
  --name "<CLUSTER_NAME>" --resource-group "<RESOURCE_GROUP>" \
  --query "addonProfiles.omsagent.enabled" -o tsv

# 3. Check if Metrics Server is running (pre-installed on AKS, but may be unhealthy)
kubectl get deployment metrics-server -n kube-system

Based on the result, follow the appropriate path:

StateRightsizing Possible?Data SourceAccuracy
Azure Managed Prometheus enabledYesPrometheus metrics via Azure MonitorBest — full P95/7-day history
Container Insights (Log Analytics) enabledYesKQL queries on Perf / KubePodInventoryGood — 7-day trends
Only Metrics Server (no Azure Monitor)Limitedkubectl top pods — live data onlyLow — no historical trends

If nothing is enabled, Metrics Server is pre-installed on AKS — confirm it is healthy and use it for live rightsizing data:

kubectl get deployment metrics-server -n kube-system
kubectl top pods --all-namespaces --sort-by=cpu

For historical P95 trends (more accurate rightsizing), recommend enabling Azure Managed Prometheus. Warn user this incurs cost and wait for confirmation before proceeding.


Detection

# Authenticate to cluster
az aks get-credentials --name "<CLUSTER_NAME>" --resource-group "<RESOURCE_GROUP>"

# List requests/limits for ALL containers per pod (includes sidecars)
# Using [*] ensures multi-container pods are not misrepresented
kubectl get pods --all-namespaces \
  -o custom-columns="NAMESPACE:.metadata.namespace,POD:.metadata.name,CONTAINERS:.spec.containers[*].name,CPU_REQ:.spec.containers[*].resources.requests.cpu,MEM_REQ:.spec.containers[*].resources.requests.memory,CPU_LIM:.spec.containers[*].resources.limits.cpu,MEM_LIM:.spec.containers[*].resources.limits.memory"

# Live per-container usage (shows each container individually, including sidecars)
kubectl top pods --all-namespaces --containers --sort-by=cpu

Historical Metrics (Azure Monitor — use when Prometheus or Container Insights is enabled)

First discover available metric names, then query:

az monitor metrics list-definitions \
  --resource "<AKS_RESOURCE_ID>" \
  --query "[].name.value" -o tsv
az monitor metrics list \
  --resource "<AKS_RESOURCE_ID>" \
  --metric "<METRIC_NAME_FROM_ABOVE>" \
  --interval PT1H --aggregation Average \
  --start-time "<YYYY-MM-DDTHH:mm:ssZ>" \
  --end-time "<YYYY-MM-DDTHH:mm:ssZ>"

Optimization Rules

ConditionRecommendationRisk
CPU request >5x P95 actualReduce to P95 * 1.2Medium
Memory request >3x P95 actualReduce to P95 * 1.2Medium
CPU request >2x P95 actualRecommend rightsizing with 20% bufferLow
No resource limits setAdd limits to prevent noisy-neighbor wasteLow
No VPA/HPA configuredSuggest enabling Vertical Pod AutoscalerLow

For VPA setup and configuration, see azure-aks-vpa.md.

YAML Patch Format

# Rightsizing patch for <NAMESPACE>/<DEPLOYMENT_NAME>
# Current: CPU request=<CURRENT>, P95 actual=<ACTUAL>
# Recommended: CPU request=<NEW> (P95 * 1.2 buffer)
apiVersion: apps/v1
kind: Deployment
metadata:
  name: <DEPLOYMENT_NAME>
  namespace: <NAMESPACE>
spec:
  template:
    spec:
      containers:
      - name: <CONTAINER_NAME>
        resources:
          requests:
            cpu: "<NEW_CPU>"
            memory: "<NEW_MEM>"
          limits:
            cpu: "<NEW_CPU_LIMIT>"     # e.g. CPU limit = 1.5x CPU request, or preserve existing limit-to-request ratio
            memory: "<NEW_MEM_LIMIT>"  # e.g. memory limit = 1.25x memory request, or preserve existing limit-to-request ratio

Risk: Medium-High. Always review patches before applying. Test in non-production first. Get explicit user confirmation before applying to production.

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 an MCP server, 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/azure-skills/skills/azure-kubernetes · commit 0696600
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from .github/plugins/azure-skills/LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Also distributed in
microsoft/azure-skills

AutoGineer is not affiliated with or endorsed by Microsoft.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download azure-kubernetes.zip