<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kubernetes on YennJ12 Engineering Blog</title><link>https://yennj12.js.org/yennj12_blog_V4/tags/kubernetes/</link><description>Recent content in Kubernetes on YennJ12 Engineering Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 22 Jun 2026 02:30:00 +0800</lastBuildDate><atom:link href="https://yennj12.js.org/yennj12_blog_V4/tags/kubernetes/feed.xml" rel="self" type="application/rss+xml"/><item><title>Kubernetes Autoscaling Complete Guide (Part 1): Horizontal Pod Autoscaler</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part1-horizontal-pod-autoscaler/</link><pubDate>Sun, 09 Nov 2025 10:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part1-horizontal-pod-autoscaler/</guid><description>Part 1 of the Kubernetes Autoscaling series: Deep dive into Horizontal Pod Autoscaler (HPA) approaches, comparing resource-based, custom metrics, external metrics, and event-driven autoscaling with KEDA. Learn when to use each approach with real-world examples and production best practices.</description></item><item><title>Kubernetes 完整指南（一）：基礎概念與架構詳解</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-complete-guide-part1-introduction-zh/</link><pubDate>Sat, 11 Oct 2025 12:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-complete-guide-part1-introduction-zh/</guid><description>🎯 前言 Kubernetes（常簡稱為 K8s）是目前最流行的容器編排平台，已成為雲原生應用的事實標準。本系列文章將全面介紹 Kubernetes 的核心概念、實務操作與生產部署。
本系列文章規劃：
第一篇（本文）：Kubernetes 基礎概念與架構 第二篇：核心資源與實務操作 第三篇：進階功能與生產實踐 📚 什麼是 Kubernetes？ 核心定義 Kubernetes 是一個開源的容器編排平台，用於自動化部署、擴展和管理容器化應用程式。它最初由 Google 設計，現在由 Cloud Native Computing Foundation（CNCF）維護。
graph TB A[Kubernetes] --&amp;gt; B[容器編排] A --&amp;gt; C[自動化部署] A --&amp;gt; D[服務發現] A --&amp;gt; E[負載均衡] A --&amp;gt; F[自動擴展] A --&amp;gt; G[自我修復] B --&amp;gt; B1[管理數千個容器] C --&amp;gt; C1[滾動更新&amp;lt;br/&amp;gt;零停機部署] D --&amp;gt; D1[DNS 與服務註冊] E --&amp;gt; E1[流量分發&amp;lt;br/&amp;gt;健康檢查] F --&amp;gt; F1[水平/垂直擴展&amp;lt;br/&amp;gt;自動調度] G --&amp;gt; G1[故障恢復&amp;lt;br/&amp;gt;重啟容器] style A fill:#326ce5 style B fill:#4ecdc4 style C fill:#feca57 style D fill:#ff6b6b style E fill:#a8e6cf style F fill:#ffb3ba style G fill:#bae1ff Kubernetes 解決的問題 挑戰 傳統方式 Kubernetes 解決方案 容器管理 手動管理每個容器 聲明式配置，自動管理 服務發現 硬編碼 IP 位址 內建 DNS 與服務發現 負載均衡 外部負載均衡器 內建 Service 負載均衡 擴展性 手動添加實例 自動水平擴展（HPA） 故障恢復 人工介入 自我修復，自動重啟 更新部署 停機維護 滾動更新，零停機 資源利用 低效分配 智慧調度，資源優化 配置管理 散落各處 統一的 ConfigMap/Secret 🔄 為什麼需要 Kubernetes？ 容器化的演進 graph LR A[單體應用&amp;lt;br/&amp;gt;Monolithic] --&amp;gt; B[容器化應用&amp;lt;br/&amp;gt;Containerized] B --&amp;gt; C[容器編排&amp;lt;br/&amp;gt;Orchestrated] C --&amp;gt; D[雲原生&amp;lt;br/&amp;gt;Cloud Native] A1[難以擴展&amp;lt;br/&amp;gt;部署緩慢] --&amp;gt; A B1[可移植&amp;lt;br/&amp;gt;環境一致] --&amp;gt; B C1[自動化&amp;lt;br/&amp;gt;高可用] --&amp;gt; C D1[微服務&amp;lt;br/&amp;gt;彈性伸縮] --&amp;gt; D style A fill:#ff6b6b style B fill:#feca57 style C fill:#4ecdc4 style D fill:#a8e6cf Docker vs Kubernetes graph TB subgraph &amp;#34;Docker 生態&amp;#34; D1[Docker Engine] D2[容器運行] D3[映像管理] D4[Docker Compose&amp;lt;br/&amp;gt;單機編排] end subgraph &amp;#34;Kubernetes 生態&amp;#34; K1[容器編排] K2[叢集管理] K3[服務發現] K4[負載均衡] K5[自動擴展] K6[自我修復] K7[配置管理] K8[儲存編排] end D1 -.</description></item><item><title>Kubernetes Autoscaling Complete Guide (Part 2): Cluster Autoscaling &amp; Cloud Providers</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part2-cluster-autoscaling/</link><pubDate>Sun, 09 Nov 2025 14:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part2-cluster-autoscaling/</guid><description>Part 2 of the Kubernetes Autoscaling series: Comprehensive guide to cluster-level autoscaling covering Cluster Autoscaler, Karpenter, cloud provider-specific solutions (EKS, GKE, AKS), and emerging technologies for intelligent node provisioning and cost optimization.</description></item><item><title>Kubernetes 完整指南（二）：核心資源與 kubectl 實戰操作</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-complete-guide-part2-resources-zh/</link><pubDate>Sat, 11 Oct 2025 12:30:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-complete-guide-part2-resources-zh/</guid><description>🎯 前言 在上一篇文章中，我們了解了 Kubernetes 的基礎概念與架構。本文將深入探討核心資源對象的實務操作，透過大量範例與表格說明，幫助你全面掌握 K8s 的日常操作。
本文重點：
kubectl 指令完全指南 Pod 深度解析與操作 Workload 資源管理 Service 與網路配置 Ingress 路由管理 儲存資源操作 配置管理實戰 🔧 kubectl 指令完全指南 kubectl 指令結構 1kubectl [command] [TYPE] [NAME] [flags] 範例：
1kubectl get pods nginx-pod -o yaml 2# ↑ ↑ ↑ ↑ 3# 指令 類型 名稱 選項 基本指令分類 graph TB A[kubectl 指令] --&amp;gt; B[基礎操作] A --&amp;gt; C[部署管理] A --&amp;gt; D[除錯診斷] A --&amp;gt; E[叢集管理] A --&amp;gt; F[設定管理] B --&amp;gt; B1[get, describe&amp;lt;br/&amp;gt;logs, exec] C --&amp;gt; C1[create, apply&amp;lt;br/&amp;gt;delete, scale] D --&amp;gt; D1[logs, exec&amp;lt;br/&amp;gt;port-forward, top] E --&amp;gt; E1[cluster-info&amp;lt;br/&amp;gt;api-resources&amp;lt;br/&amp;gt;api-versions] F --&amp;gt; F1[config&amp;lt;br/&amp;gt;auth] style A fill:#326ce5 style B fill:#4ecdc4 style C fill:#feca57 style D fill:#ff6b6b style E fill:#a8e6cf style F fill:#ffb3ba kubectl 常用指令速查表 基礎操作指令 指令 用途 範例 get 列出資源 kubectl get pods describe 查看詳細資訊 kubectl describe pod nginx create 創建資源 kubectl create deployment nginx --image=nginx apply 應用配置 kubectl apply -f deployment.</description></item><item><title>Kubernetes Autoscaling Complete Guide (Part 3): Hands-On HPA Demo with Apache-PHP</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part3-hands-on-hpa-demo/</link><pubDate>Sun, 09 Nov 2025 16:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part3-hands-on-hpa-demo/</guid><description>Part 3 of the Kubernetes Autoscaling series: Hands-on tutorial demonstrating Horizontal Pod Autoscaler with a real Apache-PHP application. Includes complete AWS CDK infrastructure code, Kubernetes manifests, load testing, and step-by-step deployment guide.</description></item><item><title>Kubernetes 完整指南（三）：進階功能與生產環境實踐</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-complete-guide-part3-advanced-zh/</link><pubDate>Sat, 11 Oct 2025 13:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-complete-guide-part3-advanced-zh/</guid><description>🎯 前言 經過前兩篇的學習，我們已經掌握了 Kubernetes 的基礎概念與核心資源操作。本文將深入探討進階功能與生產環境實踐，幫助你構建企業級的容器平台。
本文重點：
自動擴展（HPA/VPA/CA） RBAC 權限管理 Network Policy 網路策略 Helm 套件管理 監控與告警系統 日誌收集方案 CI/CD 整合 生產環境最佳實踐 ⚡ 自動擴展機制 擴展類型對照 graph TB A[Kubernetes 自動擴展] --&amp;gt; B[HPA&amp;lt;br/&amp;gt;水平 Pod 擴展] A --&amp;gt; C[VPA&amp;lt;br/&amp;gt;垂直 Pod 擴展] A --&amp;gt; D[CA&amp;lt;br/&amp;gt;叢集自動擴展] B --&amp;gt; B1[根據 CPU/記憶體&amp;lt;br/&amp;gt;自動調整 Pod 數量] C --&amp;gt; C1[根據資源使用&amp;lt;br/&amp;gt;調整 Pod 資源限制] D --&amp;gt; D1[根據負載&amp;lt;br/&amp;gt;自動增減節點] style A fill:#326ce5 style B fill:#4ecdc4 style C fill:#feca57 style D fill:#ff6b6b HPA (Horizontal Pod Autoscaler) 基於 CPU 的 HPA：</description></item><item><title>Kubernetes Autoscaling Complete Guide (Part 4): Monitoring, Alerting &amp; Threshold Tuning</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part4-monitoring-alerting/</link><pubDate>Sun, 09 Nov 2025 18:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part4-monitoring-alerting/</guid><description>Part 4 of the Kubernetes Autoscaling series: Complete guide to monitoring EKS autoscaling with Prometheus and Grafana. Includes CDK setup, alerting rules, custom dashboards, and threshold tuning strategies for production-grade observability.</description></item><item><title>Kubernetes Autoscaling Complete Guide (Part 5): Vertical Pod Autoscaler &amp; Resource Optimization</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part5-vpa-resource-optimization/</link><pubDate>Sun, 09 Nov 2025 20:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part5-vpa-resource-optimization/</guid><description>Part 5 of the Kubernetes Autoscaling series: Deep dive into Vertical Pod Autoscaler (VPA), resource right-sizing strategies, combining VPA with HPA, and production-grade resource optimization techniques for cost-effective Kubernetes operations.</description></item><item><title>Kubernetes Autoscaling Complete Guide (Part 6): Advanced Autoscaling Patterns</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part6-advanced-patterns/</link><pubDate>Sun, 09 Nov 2025 22:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part6-advanced-patterns/</guid><description>Part 6 of the Kubernetes Autoscaling series: Advanced autoscaling patterns for stateful applications, multi-cluster deployments, cost optimization strategies, batch job scaling, and emerging technologies. Real-world architectures and production-grade implementations.</description></item><item><title>Kubernetes Autoscaling Complete Guide (Part 7): Production Troubleshooting &amp; War Stories</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part7-troubleshooting-war-stories/</link><pubDate>Mon, 10 Nov 2025 00:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part7-troubleshooting-war-stories/</guid><description>Part 7 of the Kubernetes Autoscaling series: Real-world production incidents, debugging workflows, common failure scenarios, and hard-learned lessons from operating autoscaling at scale. Battle-tested troubleshooting guides and postmortem analysis.</description></item><item><title>Kubernetes Autoscaling Complete Guide (Part 8): Security, Compliance &amp; Governance</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part8-security-compliance-governance/</link><pubDate>Mon, 10 Nov 2025 02:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/kubernetes-autoscaling-complete-guide-part8-security-compliance-governance/</guid><description>Part 8 of the Kubernetes Autoscaling series: Complete guide to securing autoscaling infrastructure with RBAC, policy enforcement, compliance frameworks (PCI-DSS, HIPAA, SOC2), multi-tenancy patterns, audit logging, and governance best practices for enterprise Kubernetes.</description></item><item><title>AI 工程從零開始｜Phase 17 Part 1：AI 推論服務架構 — 從單機到全球部署</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/ai-eng-from-scratch-phase17-part1-serving-zh/</link><pubDate>Mon, 22 Jun 2026 02:30:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/ai-eng-from-scratch-phase17-part1-serving-zh/</guid><description>大多數人：把 torch.load() 包一層 Flask，貼上 /predict 就叫「部署」。 真正的做法：從服務框架選型、GPU 共享策略、冷啟動預熱到多租戶隔離，每一層都有可量測的 SLO。 差距不在演算法，而在系統設計——單機 GPU 使用率 23% vs 叢集使用率 78%，成本相差 3.4 倍。 本文從 POC 到全球部署，逐層拆解 AI 推論服務的工程決策。
面試情境 你的電商平台每天有 500 萬次商品推薦請求，目前用一台 A100 跑 PyTorch 模型，P99 延遲 1.2s，GPU 使用率只有 23%。CTO 說三個月後要支援 10 倍流量，同時把 P99 壓到 200ms 以內，預算只能增加 2 倍。你會如何重新設計推論服務架構？請解釋你在服務框架選型、擴縮容策略、GPU 共享、以及多租戶隔離四個面向的決策依據。
一、核心問題：AI 推論服務與傳統 Web 服務的本質差異 AI 推論服務並不是「把模型包一個 HTTP 端點」這麼簡單。它在資源模型、延遲特性、擴縮容行為上，與傳統 Web 服務有根本性差異。
資源模型的差異
傳統 Web 服務以 CPU 為主，水平擴展幾乎無代價——增加一台虛擬機需要 30 秒，成本線性增加。AI 推論服務以 GPU 為主，GPU 節點冷啟動需要 45–120 秒（含驅動初始化、CUDA context 建立、模型載入），每台 A100 機器成本約 $3–6/hour，是 CPU 機器的 15–30 倍。</description></item><item><title>在 Kubernetes 上使用 Slurm 運行大規模 GPU 工作負載</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/nvidia-running-large-scale-gpu-workloads-on-kubernetes-wi-zh/</link><pubDate>Fri, 10 Apr 2026 08:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/nvidia-running-large-scale-gpu-workloads-on-kubernetes-wi-zh/</guid><description>本文深入探討如何在 Kubernetes 環境中利用 Slurm 進行大規模 GPU 工作負載的管理和調度。文章將介紹核心概念、技術架構、實現細節，並通過代碼示例展示如何配置和優化系統性能，最後討論常見問題和最佳實踐。</description></item><item><title>Building Centralized Grafana + Prometheus Monitoring with AWS CDK: Multi-Service Observability Platform</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/centralized-grafana-prometheus-monitoring-aws-cdk/</link><pubDate>Sat, 17 Jan 2026 11:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/centralized-grafana-prometheus-monitoring-aws-cdk/</guid><description>Comprehensive guide to architecting a production-ready centralized Prometheus + Grafana monitoring platform using AWS CDK that aggregates metrics from multiple services, clusters, and infrastructure components with federation, remote storage, and advanced alerting.</description></item><item><title>Building Production Kubernetes Platform on AWS EKS</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/building-production-kubernetes-platform-aws-eks-cdk/</link><pubDate>Sat, 30 Aug 2025 15:19:09 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/building-production-kubernetes-platform-aws-eks-cdk/</guid><description>Deep dive into architecting a comprehensive Kubernetes platform on AWS EKS with integrated data processing, monitoring, and observability using infrastructure as code.</description></item><item><title>Building Centralized Logging with OpenSearch and AWS CDK</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/building-centralized-logging-opensearch-aws-cdk/</link><pubDate>Sun, 15 Dec 2024 14:30:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/building-centralized-logging-opensearch-aws-cdk/</guid><description>Deep dive into architecting a production-ready centralized logging solution using OpenSearch, Kinesis Data Firehose, and AWS CDK for comprehensive Kubernetes cluster observability.</description></item></channel></rss>