Communitygithub.com

Azure Kubernetes Service 規劃與建立

規劃、建立並設定正式環境適用的 Azure Kubernetes Service (AKS) 叢集。涵蓋 Day-0 檢查清單、SKU 選擇 (Automatic 與 Standard)、網路選項 (私人 API 伺服器、Azure CNI Overlay、輸出設定)、安全性以及營運 (自動擴展、升級策略、成本分析)。

Azure Kubernetes Service 規劃與建立 是什麼?

此技能提供一個遵循最佳實務的 AKS 叢集設定流程,協助開發者從需求出發,區分 Day-0 與 Day-1 決策。它涵蓋了叢集類型選擇 (AKS Automatic 或 Standard)、網路模型設計 (Azure CNI Overlay 或 VNet-routable)、安全性設定 (Microsoft Entra ID、Key Vault)、監控方案 (Managed Prometheus、Container Insights)、升級策略與成本控制。此技能適合需要建立或重整 AKS 叢集的平台工程師與 DevOps 團隊,支援在 Cursor、Claude Code 等 AI 代理工具中使用。其核心依賴 Azure CLI 與 `mcp_azure_mcp_aks` MCP 工具,能提供具體的設定建議與檢查清單,確保叢集具備生產級可靠性與安全性。

相容平台~Claude Code~Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/JantonioFC/skillsbank/tree/HEAD/skills

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Azure Kubernetes Service

權威指引 — 強制遵循

此技能根據使用者需求產生建議的 AKS 叢集設定,區分Day-0 決策 (網路、API 伺服器 — 後續難以變更) 與 Day-1 功能 (可在建立後啟用)。相關指令請參閱 CLI 參考。

快速參考

屬性值
適用於AKS 叢集規劃與 Day-0 決策
MCP 工具mcp_azure_mcp_aks
CLIaz aks create, az aks show, kubectl get, kubectl describe
相關技能azure-diagnostics (AKS 故障排除), azure-validate (就緒檢查)

使用時機

當使用者需要以下事項時,啟用此技能:

  • 建立新的 AKS 叢集
  • 規劃適用於正式環境工作負載的 AKS 叢集設定
  • 設計 AKS 網路 (API 伺服器存取、Pod IP 模型、輸出)
  • 設定 AKS 身分識別與祕密管理
  • 設定 AKS 治理 (Azure Policy、部署防護)
  • 啟用 AKS 可觀測性 (Container Insights、Managed Prometheus、Grafana)
  • 定義 AKS 升級與修補策略
  • 啟用 AKS 成本可視性與分析
  • 了解 AKS Automatic 與 Standard SKU 之間的差異
  • 取得 AKS 叢集設定與組態的 Day-0 檢查清單

規則

  1. 從使用者對於計算、網路、安全性及其他設定的需求開始。
  2. 使用 azure MCP 伺服器,並先選取 mcp_azure_mcp_aks 以探索用戶端提供的確切 AKS 特定 MCP 工具。選擇最適合任務的最小發現工具,僅在所需功能未透過 AKS MCP 表面暴露時,才回退至 Azure CLI (az aks)。
  3. 根據使用者對控制與便利性的需求,判斷 AKS Automatic 或 Standard SKU 何者更合適。除非有特定的自訂需求,否則預設使用 AKS Automatic。
  4. 記錄叢集設定選擇的決策與理由,特別是後續難以變更的 Day-0 決策 (網路、API 伺服器存取)。

必要輸入 (僅詢問必要資訊)

若使用者不確定,則使用安全預設值。

  • AKS 環境類型:開發/測試或正式環境
  • 區域、可用性區域、偏好的節點 VM 大小
  • 預期規模 (節點/叢集數量、工作負載大小)
  • 網路需求 (API 伺服器存取、Pod IP 模型、輸入/輸出控制)
  • 安全性與身分識別需求,包括映像登錄
  • 升級與可觀測性偏好
  • 成本限制

工作流程

1. 叢集類型

  • AKS Automatic (預設):適用於多數正式環境工作負載,提供精選體驗,內建安全性、可靠性與效能的最佳實務。除非您對網路、自動擴展或節點集區設定有特定自訂需求,且這些需求不受節點自動佈建 (NAP) 支援,否則請使用此選項。
  • AKS Standard:當您需要完整控制環境設定時使用,但需要額外負擔來設定與管理。

2. 網路 (Pod IP、輸出、輸入、資料層)

Pod IP 模型 (關鍵 Day-0 決策):

  • Azure CNI Overlay (建議):Pod IP 來自私人 Overlay 範圍,非 VNet 可路由,可擴展至大型環境,適合多數工作負載
  • Azure CNI (VNet 可路由):Pod IP 直接來自 VNet (Pod 子網路或節點子網路),當 Pod 必須從 VNet 或內部部署直接定址時使用

資料層與網路原則:

  • Azure CNI powered by Cilium (建議):基於 eBPF,提供高效能封包處理、網路原則與可觀測性

輸出:

  • 靜態輸出閘道:提供穩定、可預測的對外 IP
  • 對於受限輸出:UDR + Azure Firewall 或 NVA

輸入:

  • App Routing 附加元件搭配 Gateway API — 適用於 HTTP/HTTPS 工作負載的建議預設選項
  • Istio 服務網格搭配 Gateway API — 適用於進階流量管理、mTLS、金絲雀發布
  • Application Gateway for Containers — 用於 L7 負載平衡並整合 WAF

DNS:

  • 在所有節點集區上啟用 LocalDNS,以獲得可靠且高效能的 DNS 解析

3. 安全性

  • 全面使用 Microsoft Entra ID (控制平面、工作負載身分識別 (Workload Identity) 用於 Pod、節點存取)。避免使用靜態憑證。
  • 透過 Secrets Store CSI Driver 使用 Azure Key Vault 管理祕密
  • 啟用 Azure Policy + 部署防護 (Deployment Safeguards)
  • 為 etcd/API 伺服器啟用靜態加密;為節點間通訊啟用傳輸中加密
  • 僅允許已簽署且經原則核准的映像 (Azure Policy + Ratify),建議使用 Azure Container Registry
  • 隔離:使用命名空間、網路原則、限範圍記錄

4. 可觀測性

  • 使用 Managed Prometheus 與 Container Insights 搭配 Grafana 來進行 AKS 可觀測性 (記錄 + 指標)。
  • 啟用診斷設定,將控制平面記錄與稽核記錄收集至 Log Analytics 工作區,以進行安全性監控與故障排除。
  • 針對其他監控與故障排除工具,可使用 AKS 的 Agentic CLI、Application Insights、Resource Health Center、AppLens 偵測器與 Azure Advisor 等功能。

5. 升級與修補

  • 設定維護視窗以控制升級時間
  • 啟用自動升級以維持控制平面與節點作業系統的安全性修補程式及 Kubernetes 版本更新
  • 考慮將 AKS 環境升級至 Premium 層,以使用長期支援 (LTS) 版本 (2 年支援) 獲得企業級穩定性
  • Fleet 升級:使用 AKS Fleet Manager 進行從測試到正式環境的分階段部署

6. 效能

  • 使用暫時性 OS 磁碟 (--node-osdisk-type Ephemeral) 來加快節點啟動速度
  • 選用 Azure Linux 作為節點作業系統 (佔用空間更小、啟動更快)
  • 啟用 KEDA 以實現超越 HPA 的事件驅動自動擴展

7. 節點集區與計算

  • 專用系統節點集區:至少 2 個節點,加上污點 (taint) 僅限系統工作負載使用 (CriticalAddonsOnly)
  • 在所有集區上啟用節點自動佈建 (NAP),以節省成本並獲得回應式擴展
  • 使用最新世代 SKU (v5/v6) 以獲得主機層級最佳化
  • 避免使用 B 系列 VM — 可爆量 SKU 會導致效能/可靠性問題
  • 在正式環境工作負載中使用至少具有 4 個 vCPU 的 SKU
  • 設定拓撲散佈限制,以根據 SLO 將 Pod 分散至主機/可用區域

8. 可靠性

  • 部署至 3 個可用性區域 (--zones 1 2 3)
  • 使用 Standard 層以獲得區域備援控制平面及 99.95% 的 API 伺服器可用性 SLA
  • 啟用 Microsoft Defender for Containers 以進行執行階段保護
  • 為所有正式環境工作負載設定 PodDisruptionBudgets
  • 使用拓撲散佈限制以確保 Pod 跨故障域分佈

9. 成本控制

  • 使用** Spot 節點集區** 來處理批次/可中斷工作負載 (最高可節省 90% 成本)
  • 停止/啟動 開發/測試叢集:az aks stop/start
  • 針對穩定狀態的工作負載,考慮使用保留執行個體或節省方案

護欄 / 安全注意事項

  • 請勿要求或輸出祕密 (權杖、金鑰)。
  • 如果對於 Day-0 關鍵決策的需求不明確,請向使用者提出釐清問題。對於 Day-1 可啟用的功能,提出 2–3 個安全選項並說明取捨,然後選擇一個保守預設值。
  • 請勿承諾零停機時間;應建議工作負載防護措施 (PDB、探針、複本) 與分階段升級,以及可靠性與效能的最佳實務。

MCP 工具

工具用途關鍵參數
mcp_azure_mcp_aksAKS MCP 進入點,用於探索用戶端暴露的確切 AKS 特定工具先探索可呼叫的 AKS 工具,然後使用該工具的參數

錯誤處理

錯誤 / 徵狀可能原因補救措施
MCP 工具呼叫失敗或逾時無效的憑證、訂用帳戶或 AKS 環境驗證 az login,使用 az account show 確認作用中訂用帳戶,並檢查目標資源群組,同時避免向使用者回顯訂用帳戶識別碼
配額超過區域 vCPU 或資源限制要求提高配額,或選取不同的區域/VM SKU
網路衝突 (IP 耗盡)Pod 子網路對於 Overlay/CNI 而言太小重新規劃 IP 範圍;可能需要重建叢集 (Day-0)
Workload Identity 無法運作缺少 OIDC 簽發者或同盟身分憑證啟用 --enable-oidc-issuer --enable-workload-identity,設定同盟身分識別

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

JantonioFC/skillsbank

AI-powered image editing with style transfer and object removal

JantonioFC/skillsbank

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

JantonioFC/skillsbank

Analise e auditoria de editais de leilao judicial e extrajudicial. Riscos ocultos, clausulas perigosas, debitos, ocupante e classificacao da oportunidade.

JantonioFC/skillsbank

Embed Photopea in web apps using photopea.js. Covers embedding, file I/O, scripting, exporting, layers, text, filters, and the full Photoshop-compatible API.

JantonioFC/skillsbank

Best practices for Remotion - Video creation in React

JantonioFC/skillsbank

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

JantonioFC/skillsbank

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

JantonioFC/skillsbank

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

JantonioFC/skillsbank

Video and audio perception, indexing, and editing. Ingest files/URLs/live streams, build visual/spoken indexes, search with timestamps, edit timelines, add overlays/subtitles, generate media, and create real-time alerts.

JantonioFC/skillsbank

Upload, stream, search, edit, transcribe, and generate AI video and audio using the VideoDB SDK.

JantonioFC/skillsbank

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

JantonioFC/skillsbank

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

JantonioFC/skillsbank

Tool lifecycle UI components for React/Next.js from ui.inference.sh. Display tool calls: pending, progress, approval required, results. Capabilities: tool status, progress indicators, approval flows, results display. Use for: showing agent tool calls, human-in-the-loop approvals, tool output. Triggers: tool ui, tool calls, tool status, tool approval, tool results, agent tools, mcp tools ui, function calling ui, tool lifecycle, tool pending

JantonioFC/skillsbank

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

JantonioFC/skillsbank

When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms. Also use when the user mentions 'PPC,' 'paid media,' 'ROAS,' 'CPA,' 'ad campaign,' 'retargeting,' 'audience targeting,' 'Google Ads,' 'Facebook ads,'...

JantonioFC/skillsbank

Create AI avatar and talking head videos with OmniHuman, Fabric, PixVerse via inference.sh CLI. Models: OmniHuman 1.5, OmniHuman 1.0, Fabric 1.0, PixVerse Lipsync. Capabilities: audio-driven avatars, lipsync videos, talking head generation, virtual presenters. Use for: AI presenters, expla...

JantonioFC/skillsbank

Create AI marketing videos for ads, promos, product launches, and brand content. Models: Veo, Seedance, Wan, FLUX for visuals, Kokoro for voiceover. Types: product demos, testimonials, explainers, social ads, brand videos. Use for: Facebook ads, YouTube ads, product launches, brand awarene...

JantonioFC/skillsbank

Generate AI videos with Google Veo, Seedance, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 1.5 Pro, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, lipsync, avatar animation, video upscaling, fole...

JantonioFC/skillsbank

Production-ready CI/CD configurations for Playwright — GitHub Actions, GitLab CI, CircleCI, Azure DevOps, Jenkins, Docker, parallel sharding, reporting, code coverage, and global setup/teardown.

JantonioFC/skillsbank

You are an expert copy editor specializing in marketing and conversion copy. Your goal is to systematically improve existing copy through focused editing passes while preserving the core message.

相關技能