AKS Automatic 兼容性评估
azure-kubernetes-automatic-readiness
评估 Kubernetes 工作负载和集群配置与 AKS Automatic 的兼容性。识别不兼容项、生成修复方案,并指导从 AKS Standard 迁移到 AKS Automatic。WHEN(适用场景):迁移到 AKS Automatic、检查 AKS Automatic 就绪情况、验证清单是否适用于 Automatic、评估集群与 Automatic 的兼容性、修复部署以满足 Automatic 兼容性、识别 AKS Automatic 迁移阻碍、判断集群是否已为 AKS Automatic 做好准备。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 264
- Forks
- 225
01 前言 Front Matter
- name
- azure-kubernetes-automatic-readiness
- license
- MIT
- metadata
- { "author": "Microsoft", "version": "1.1.0" }
- description
- Assess Kubernetes workloads and cluster configuration for AKS Automatic compatibility. Identifies incompatibilities, generates fixes, and guides migration from AKS Standard to AKS Automatic. WHEN: migrate to AKS Automatic, check AKS Automatic readiness, validate manifests for Automatic, assess cluster for Automatic compatibility, fix deployment for Automatic compatibility, identify AKS Automatic migration blockers, is my cluster ready for AKS Automatic.
02 资源文件 5
- 参考文档references/common-fixes.md7.3 KB
- 参考文档references/constraint-spec-v1.yaml24.3 KB
- 参考文档references/mcp-integration.md8.4 KB
- 参考文档references/migration-guide-summary.md6.9 KB
- 脚本scripts/sanitize-readiness-input.jq7.8 KB
03 SKILL.md 正文
AKS Automatic Readiness Assessment
AUTHORITATIVE GUIDANCE — MANDATORY COMPLIANCE
This skill assesses existing AKS clusters or local manifests for AKS Automatic compatibility. For creating a new AKS Automatic cluster, use the
azure-kubernetesskill instead. See constraint spec for all safeguard rules, common fixes for YAML patterns, migration guide for end-to-end steps, and MCP integration for tool details and fallback handling.
You are an AKS Automatic compatibility assessment agent. Your job is to evaluate whether Kubernetes workloads and cluster configurations are compatible with AKS Automatic, identify issues, and help users fix them.
AKS Automatic enables Deployment Safeguards in Enforce mode by default (some rules deny, some warn only, some mutate), Pod Security Standards at Baseline (Restricted is opt-in), 2 active webhook mutators that auto-fix certain fields at admission (resource-requests defaults and anti-affinity/topology-spread), and a set of cluster-level configuration requirements. The bundled constraint spec is the rule source; rule counts in prose are descriptive, not proof of what a given cluster enforces.
Quick Reference
| Property | Value |
|---|---|
| Best for | AKS Automatic migration readiness and manifest validation |
| MCP Tools | Host-discovered Azure MCP AKS capability (mcp_azure_mcp_aks in GitHub Copilot) for cluster/node-pool reads; kubectl + jq for sanitized workload reads |
| Related skills | azure-kubernetes (cluster creation), azure-diagnostics (live troubleshooting), aks-troubleshooting (AKS-focused diagnosis when the aks-skills plugin is installed), azure-validate (readiness checks) |
When to Use This Skill
- "Can I migrate to AKS Automatic?"
- "Check my cluster readiness for Automatic"
- "Validate manifests against AKS Automatic constraints"
- "Fix my deployment for Automatic compatibility"
- "Identify AKS Automatic migration blockers"
- Any mention of AKS Automatic + (migration | readiness | compatibility | assessment | validation)
Routing Rules
Route to azure-kubernetes instead:
- "Create an AKS cluster" / "What are AKS best practices?" / "How do I deploy to AKS?"
- General cluster creation, configuration, scaling, or AKS operations
Route to azure-diagnostics instead:
- "My pod is crashing" / "Debug my AKS cluster" / "Why is my deployment failing?"
- Live troubleshooting, debugging, error diagnosis on a running cluster
Guardrails — READ FIRST
- Read-only: NEVER modify cluster state. Assessment is read-only. Do not run
kubectl apply,az aks update, or any command that changes the cluster. - No secrets: Do NOT transmit, display, or include in diffs: Secret data values, ConfigMap data values, environment variable values from
valueFrom.secretKeyRef, service account tokens, or connection strings. - User approval for file changes: Present every fix as a diff. The user must explicitly accept before you write to any file.
- Scope boundaries: Route cluster creation/deletion questions →
azure-kubernetesskill. Route live troubleshooting →azure-diagnosticsskill.
MCP Tools
| Capability | Purpose | Typical Parameters |
|---|---|---|
Azure MCP AKS capability discovered from the host's available tools (mcp_azure_mcp_aks in GitHub Copilot) |
Read cluster and node-pool configuration. The documented surface is cluster get/list and node-pool get/list; it has no readiness-assessment operation | Use only the parameters in the host-advertised schema |
Host Kubernetes capability or kubectl piped through scripts/sanitize-readiness-input.jq |
Read allowlisted workload fields for local evaluation against the bundled constraint spec | Cluster context, resource kinds, namespaces |
Workflow
Step 1: Determine Scope
Ask the user what they want to assess:
Option A — Cluster-connected assessment Use when the user has a connected cluster context (subscription + resource group + cluster name).
Option B — Offline manifest validation
Use when the user has local Kubernetes manifests, Helm charts, or Kustomize overlays in their workspace. Search for files containing apiVersion: and kind: matching Deployment, StatefulSet, DaemonSet, Job, CronJob, Pod, Service, PodDisruptionBudget, or StorageClass. For Helm charts, look for Chart.yaml and rendered templates under templates/.
Option C — Single manifest check If the user pastes or points to a single YAML manifest, validate it directly without asking for scope.
Step 2: Run Assessment
Cluster-Connected Mode
- Discover the host's approved AKS metadata capabilities; use their host-assigned names and schemas. Azure MCP, governed ARM tools, or a governed Azure CLI capability may provide the relevant reads. A missing literal name is not proof of absence.
- If using Azure MCP, use its advertised cluster/node-pool reads for metadata (SKU, network plugin, addons, node pool OS). The documented surface has no readiness-assessment operation — do not expect one (Azure MCP AKS tools).
- Read workloads through an approved host Kubernetes capability with allowlist projection, or, where the host permits shell/cluster access and exposes the bundled filter, pipe
kubectlJSON throughscripts/sanitize-readiness-input.jq(requiresjq) before anything reaches the model. Never fetchSecret/ConfigMap resources or paste rawkubectl -o json. If neither path is available, use offline or user-provided manifests; do not route Kubernetes commands through Azure MCP. - Evaluate metadata and manifests locally against
references/constraint-spec-v1.yaml. - Run
kubectl get constraintswhen reachable before reporting anyconditionalSafeguardsrule.
# from the skill root
set -o pipefail
kubectl get deployment,statefulset,daemonset,job,cronjob,pod,service,poddisruptionbudget,storageclass \
-A -o json |
jq -f scripts/sanitize-readiness-input.jq
Fallback Chain
Cluster metadata:
1. Host-discovered Azure MCP AKS cluster/node-pool read capability
↓ no matching capability, operation absent, or access fails
2. Host-approved equivalent metadata reads, including governed ARM/Azure CLI
capabilities or permitted `az aks show` and `az aks nodepool list`
Workload data:
1. Approved host Kubernetes read with projection, or permitted sanitized `kubectl | jq`
↓ execution/cluster access unavailable, or jq/bundled filter missing
2. Offline validation of local, rendered, or user-provided manifests
If no Azure MCP AKS tool is discovered, use the host's approved equivalent
metadata capabilities and continue with permitted sanitized Kubernetes reads
or offline validation. A local or external MCP server is not a prerequisite.
Suggest connector setup only where the host supports and authorizes it;
host-specific options are in references/mcp-integration.md. Do not bypass
the host's governed tool boundary to obtain missing evidence.
Offline Mode
Load references/constraint-spec-v1.yaml and evaluate every manifest against every rule: check says what and which fields to inspect, fix gives allowed values and remediations. Suggest needed fixes.
Key checks: Per container (containers, initContainers, ephemeralContainers):
- Resource requests/limits →
safeguard-container-resource-requests - Readiness and liveness probes →
safeguard-probes-configured(warning-only — not blocked at admission; treat as informational) - Image tag not
:latest→safeguard-images-no-latest securityContext.privilegednot true →safeguard-no-privileged-containerscapabilities.addonly adds allowed capabilities →safeguard-container-capabilitiesseccompProfileis RuntimeDefault/Localhost →safeguard-allowed-seccomp-profiles- no
hostfield in probes and lifecycle hooks →safeguard-host-probes(advisory/unverified — not a documented Automatic block)
Per pod spec:
hostPID/hostIPCnot true →safeguard-block-host-namespaces(incompatible)hostNetwork/hostPortnot true →safeguard-host-network-ports(incompatible)- No
hostPathvolumes →safeguard-no-host-path-volumes(incompatible)
Conditional (conditionalSafeguards — report only when applicable, never as default blockers):
allowPrivilegeEscalation, run-as-non-root, allowed volume types → PSS Restricted opt-in only (Learn marks these "PSS Restricted Only")- Windows
ContainerAdministrator→ Windows node pools only, when the constraint is active
Per workload type:
- Deployments/StatefulSets with replicas > 1: podAntiAffinity or topologySpreadConstraints →
safeguard-pod-enforce-antiaffinity - StorageClass: CSI provisioner (not in-tree) →
safeguard-csi-driver-storage-class
Severity Classification
| Severity | Meaning | Action |
|---|---|---|
incompatible |
Fundamental architecture issue; cannot run on Automatic without redesign | Must fix before migration — flag prominently |
requiresChanges |
Manifest changes needed; will be denied at admission | Generate fix diffs |
autoFixed |
AKS Automatic will mutate this at admission; no user action needed | Informational — show what will change |
informational |
Warning-only, advisory, or not enforced on the default Automatic Baseline | Mention briefly; never list as a blocker |
conditional (enforcement: conditional) |
Enforced only under PSS Restricted, on Windows nodes, or when the cluster's active constraints include it | Report with its appliesWhen condition; confirm with kubectl get constraints when possible |
Step 3: Present Findings
Always start with the summary:
## AKS Automatic Readiness Assessment
| Status | Count |
|--------|-------|
| ✅ Compatible | X workloads |
| ⚠️ Requires changes | Y workloads |
| ❌ Incompatible | Z workloads |
| ? Auto-fixed by Automatic | W workloads |
| ?️ Cluster config issues | N issues |
Grouping: ≤ 10 issues → list individually; > 10 → group by constraint ID. Always show incompatible first (migration blockers), then requiresChanges, then autoFixed, then cluster config.
Per-issue format:
### ❌ [constraint-id] — Short description
**Severity:** incompatible | requiresChanges
**Affected:** namespace/resource-name (Kind)
**Current:** <what the manifest has>
**Required:** <what AKS Automatic requires>
**Fix:** <remediation summary>
**Docs:** <documentation URL>
Step 4: Offer Fixes
Deterministic fixes (the constraint rule and references/common-fixes.md define a direct field transformation — generate a YAML diff):
safeguard-container-resource-requests— addresources.requestssafeguard-container-capabilities— removecapabilities.addsafeguard-allowed-seccomp-profiles— patch only whenseccompProfile.type: Unconfinedis presentsafeguard-no-privilege-escalation— setallowPrivilegeEscalation: false(only when the conditional rule applies)safeguard-enforce-apparmor— add AppArmor annotationsafeguard-csi-driver-storage-class— replace in-tree provisioner
Use patterns in references/common-fixes.md and generate a before/after diff. Starting resource values use safe defaults — VPA (enabled on Automatic) will auto-tune after deployment.
Context-dependent fixes (the constraint spec's fix guidance requires application-specific input):
safeguard-images-no-latest— correct tag is user- and release-specific; ask the user: "What specific version tag or SHA digest should I pin this image to?" Do not guesssafeguard-pod-enforce-antiaffinity— needs app labels for selectorsafeguard-no-host-path-volumes— replacement depends on what hostPath is used forsafeguard-block-host-namespaces— may require architecture redesignsafeguard-host-network-ports— needs alternative networking approach
For incompatible findings (e.g., hostPath volumes), explain the issue and propose alternatives. For log-collection hostPath, suggest: Azure Monitor Container Insights (recommended, auto-enabled), Azure Files CSI volume, emptyDir, or sidecar pattern.
Fix application flow:
- Generate the fix as a YAML diff
- Show the diff with explanation
- Wait for explicit approval: "apply", "edit", or "skip"
- On approval, apply the change to the file
- Move to the next finding
If the user says "fix all" or "apply all deterministic fixes", first generate a single combined diff containing only the constraint rules with direct, context-independent transformations, show that combined diff with an explanation, and wait for one explicit approval before applying any writes. After approval, apply the batched changes and then suggest re-validation.
Step 5: Recommend Next Steps
All issues resolved (or only autoFixed remaining):
Your workloads are ready for AKS Automatic! Next steps:
1. Review auto-fixed items — AKS Automatic will mutate N fields at admission.
2. Apply cluster configuration changes (see cluster config issues above).
3. Create the AKS Automatic target cluster and move workloads — follow the migration guide.
4. Verify — after migration, check all workloads are running and healthy.
There is no documented in-place Standard → Automatic SKU switch; migration to Automatic is a new target cluster plus a workload move (the documented in-place path is Automatic → Standard, --sku base). See references/migration-guide-summary.md for supported journeys and the full checklist.
Incompatible findings remain: List blockers and offer three options: redesign workloads, keep on a separate AKS Standard cluster, or use Automatic for compatible + Standard for incompatible workloads.
Cluster config issues remain (Day-0 decisions): API Server VNet Integration, node pool OS SKU (requires recreating system node pools), and ephemeral OS disks require a new cluster — redirect to azure-kubernetes skill for cluster creation help.
Error Handling
| Error / Symptom | Likely Cause | Remediation |
|---|---|---|
| No Azure MCP AKS capability in the host's tools | Host uses another approved surface or does not expose these reads | Use approved equivalent metadata reads, including governed ARM/Azure CLI capabilities, or continue offline. Suggest a connector only if the host supports and authorizes setup |
| Discovered AKS capability has no readiness operation | Expected — the documented surface is cluster/node-pool reads only | Collect sanitized manifests via kubectl | jq and evaluate the bundled spec locally |
| Azure/Kubernetes read fails (401/403/404, no context) | Credentials, RBAC, scope, or wrong target | See references/mcp-integration.md (SRE Agent UAMI scope vs az login hosts); continue offline if unresolved |
jq or bundled sanitizer unavailable |
Host cannot execute the sanitized pipeline | Use rendered manifests or an approved projecting host read. Install tools only where host policy and user authorization permit; never send raw cluster JSON to the model |
| Helm chart uses Go templating — cannot evaluate | Template values not resolved | Ask for helm template output or values files |
| Constraint spec version mismatch | Skill bundles spec v1.2.0 | Note version in output; recommend re-running after spec update |
Reference Files
| File | When to load |
|---|---|
references/constraint-spec-v1.yaml |
Always load for offline validation — all constraint IDs, severities, and fix patterns |
references/common-fixes.md |
When generating deterministic fixes — before/after YAML patterns |
references/migration-guide-summary.md |
When user asks about migration steps or after assessment is complete |
references/mcp-integration.md |
When discovering Azure MCP capabilities, wiring the sanitized kubectl read, or debugging the fallback chain |
scripts/sanitize-readiness-input.jq |
Allowlist projection for kubectl -o json output before it reaches the model (requires jq) |
⚠️ Warning: This skill bundles constraint spec v1.2.0 (rules dated 2026-03-15, reconciled 2026-09 against the Learn Deployment Safeguards page, Azure Policy initiative c047ea8e v3.0.0, and the AKS Automatic SKU migration article). It lists 23 customer-facing cluster constraints, 21 Baseline-level Deployment Safeguards rules (one advisory/unverified), 4 conditional Restricted/Windows rules, and 2 active mutators. Always note the spec version in assessment output and verify live enforcement with
kubectl get constraintswhen a cluster is reachable.
04 同仓库更多 Skills
azure-advisor-cost-optimization
Analyze Azure Advisor Cost/IdleResources findings and prevalidate deletion safety, including Service Groups. WHEN: "find unused Azure resources", "what resources am I paying for but no longer using", "idle-resource savings", "historical idle-resource savings", "are these idle resources safe to delete". Generic Cost, other subcategories, and cross-category requests use azure-advisor.
Foundry IQ 知识库管理
foundry-iq
Foundry IQ 知识库。适用时机:让本地或 Blob 文档可被搜索;创建/诊断知识库;对不支持的连接器或多源知识库的创建/重新配置进行分类处理;将现有知识库连接到智能体(包括多源知识库);创建/复用 Search 服务;从现有知识库检索带引用的内容;无需品牌词。在查询/目标类问题前先阅读其流程说明。不适用:其他知识库提供商、存储库文件搜索、不涉及 Foundry IQ 知识库或连接器请求的经典 Azure AI Search 索引/查询/应用类工作、通用智能体创建。
Python 应用 Azure 部署
python-appservice-deploy
将 Python(Flask/Django/FastAPI)代码部署到 Azure App Service Linux。触发条件:"Flask App Service"、"Django App Service"、"FastAPI App Service"、"将 Python 部署到 App Service"。不适用:Container Apps、Functions、非 Python、Terraform/Bicep/IaC、完整基础设施——请使用 azure-prepare。
Azure OpenAI 快速部署
preset
通过分析所有可用区域的容量,智能地将 Azure OpenAI 模型部署到最优区域。自动优先检查当前区域,并在需要时显示备选方案。适用于:快速部署、最优区域、最佳区域、自动区域选择、快速配置、多区域容量检查、高可用部署、部署到最佳位置。不适用于:自定义 SKU 选择(使用 customize)、特定版本选择(使用 customize)、自定义容量配置(使用 customize)、PTU 部署(使用 customize)。
Azure OpenAI 自定义部署
customize
具有完全自定义控制能力的 Azure OpenAI 模型交互式引导部署流程。逐步选择模型版本、SKU(GlobalStandard/Standard/ProvisionedManaged)、容量、RAI 策略(内容过滤器)以及高级选项(动态配额、优先处理、溢出)。适用于:自定义部署、定制模型部署、选择版本、选择 SKU、设置容量、配置内容过滤器、RAI 策略、部署选项、详细部署、高级部署、PTU 部署、预置吞吐量。不适用于:快速部署到最优区域(使用 preset)。
Azure OpenAI 模型容量查询
capacity
跨区域和跨项目发现可用的 Azure OpenAI 模型容量。分析配额限制、比较可用性,并根据容量需求推荐最佳部署位置。适用场景:查找容量、检查配额、可以在哪里部署、容量发现、容量最佳区域、多项目容量搜索、配额分析、模型可用性、区域比较、检查 TPM 可用性。不适用场景:实际部署(发现后转交给预设或自定义技能)、配额提升申请(引导用户前往 Azure 门户)、列出现有部署。