diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 42cb1bf..4e3050e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,7 +43,7 @@ git push origin docs/your-feature ### 分支命名 -``` +```text docs/模块名-简要描述 fix/问题描述 feat/新功能描述 @@ -56,7 +56,7 @@ feat/新功能描述 ### Commit 信息格式 -``` +```text (): ``` diff --git a/src/content/docs/CONTRIBUTING.md b/src/content/docs/CONTRIBUTING.md index 7991c73..cbf5485 100644 --- a/src/content/docs/CONTRIBUTING.md +++ b/src/content/docs/CONTRIBUTING.md @@ -43,7 +43,7 @@ git push origin docs/your-feature ### 分支命名 -``` +```text docs/模块名-简要描述 fix/问题描述 feat/新功能描述 @@ -56,7 +56,7 @@ feat/新功能描述 ### Commit 信息格式 -``` +```text (): ``` diff --git a/src/content/docs/EVOLUTION_PLAN.md b/src/content/docs/EVOLUTION_PLAN.md index eea3359..3228516 100644 --- a/src/content/docs/EVOLUTION_PLAN.md +++ b/src/content/docs/EVOLUTION_PLAN.md @@ -101,7 +101,7 @@ title: "🧬 TKE Workshop 自进化计划" ### Agent 执行日志 -``` +```text [2026-04-03] content-gap-filler: 填充 data/storage.md(CBS/CFS StorageClass、PVC、StatefulSet、扩容、常见问题) [2026-04-03] content-gap-filler: 填充 best-practices/observability/monitoring.md(TMP接入、PromQL、告警规则、Grafana大盘) [2026-04-02] 进化计划文档初始化,3个自动化任务创建完成(content-gap-filler/link-checker/ai-copilot-enricher) diff --git a/src/content/docs/PRODUCT_ROADMAP.md b/src/content/docs/PRODUCT_ROADMAP.md index 27fac78..0e025dd 100644 --- a/src/content/docs/PRODUCT_ROADMAP.md +++ b/src/content/docs/PRODUCT_ROADMAP.md @@ -94,7 +94,7 @@ title: "TKE Workshop 产品路线图 (Product Roadmap)" #### 1.1 补全核心模块文档 (优先级: P0) **网络模块 (Networking)**: -``` +```text networking/ ├── index.md # 网络概述 ├── service/ @@ -122,7 +122,7 @@ networking/ ``` **可观测性模块 (Observability)**: -``` +```text observability/ ├── index.md # 可观测性概述 ├── monitoring/ @@ -146,7 +146,7 @@ observability/ ``` **控制平面模块 (Control Plane)**: -``` +```text control-plane/ ├── index.md # 控制平面概述 ├── architecture/ @@ -170,7 +170,7 @@ control-plane/ **目标**: 从 40% → 100% -``` +```text ai-ml/ ├── index.md # ✅ 已完成 ├── gpu-basics/ @@ -200,7 +200,7 @@ ai-ml/ **目标**: 从 20% → 100% -``` +```text data/ ├── index.md # ✅ 已完成 ├── storage/ @@ -277,7 +277,7 @@ data/ **功能设计**: -``` +```text features/interactive-labs/ ├── browser-terminal/ # 浏览器内终端 │ ├── xterm.js 集成 @@ -294,7 +294,7 @@ features/interactive-labs/ ``` **用户体验**: -``` +```text ┌─────────────────────────────────────────────────┐ │ 📘 创建 TKE 集群 │ ├─────────────────────────────────────────────────┤ @@ -361,7 +361,7 @@ features/interactive-labs/ - 🎓 完成所有基础模块 4. **可视化仪表盘** - ``` + ```text ┌─────────────────────────────────────┐ │ 👤 用户: virgilliang │ ├─────────────────────────────────────┤ @@ -389,7 +389,7 @@ features/interactive-labs/ 3. **TKE 架构师 (Architect)** - 全部模块 + 最佳实践 **认证流程**: -``` +```text 1. 完成所有模块学习 ↓ 2. 通过在线考试 (多选题 + 实操题) @@ -410,7 +410,7 @@ features/interactive-labs/ **技术选型**: GitHub Discussions **论坛分区**: -``` +```text tke-workshop/discussions/ ├── 💬 General # 通用讨论 ├── 🙋 Q&A # 问答 @@ -450,7 +450,7 @@ tke-workshop/discussions/ **内容规划**: -``` +```text case-studies/ ├── e-commerce/ │ ├── architecture.md # 电商平台架构 @@ -561,7 +561,7 @@ starlight({ **优化方案**: -``` +```text ┌────────────────────────────────────────────────┐ │ 🎯 TKE Workshop │ │ AI-First 云原生学习平台 │ diff --git a/src/content/docs/ai-ml/ai-copilot/index.md b/src/content/docs/ai-ml/ai-copilot/index.md index 9d2e126..99a7521 100644 --- a/src/content/docs/ai-ml/ai-copilot/index.md +++ b/src/content/docs/ai-ml/ai-copilot/index.md @@ -37,14 +37,14 @@ TKE Skill 通过两个 CLI 工具提供完整的云原生运维能力: ### 📋 TKE 集群管理 -``` +```text 帮我查一下广州地域的 TKE 集群 获取集群 cls-xxx 的 kubeconfig ``` ### ☸️ K8s 资源操作 -``` +```text 帮我查看 default 命名空间的 Pod 状态 查看 my-app Pod 的日志 执行进入 my-app Pod 的 shell @@ -52,7 +52,7 @@ TKE Skill 通过两个 CLI 工具提供完整的云原生运维能力: ### 🚀 一句话部署应用 -``` +```text 帮我部署一个"你好,猴哥"静态页面到 TKE 集群 帮我把本地项目打包成镜像并部署到 TKE ``` @@ -64,7 +64,7 @@ AI 将自动完成: ### 🔧 智能运维排障 -``` +```text 帮我检查 my-app 为什么部署失败 分析 Pod 状态、查看日志、排查问题原因 ``` @@ -76,14 +76,14 @@ AI 将自动完成: ### ⛵ Helm 包管理 -``` +```text 帮我用 Helm 安装 nginx,3 副本,开启等待 帮我列出所有已安装的 Helm Release ``` ### 🐳 TCR 镜像仓库 -``` +```text 帮我查看广州地域的 TCR 实例 创建一个镜像仓库 my-app ``` @@ -92,7 +92,7 @@ AI 将自动完成: 一句话为团队成员创建权限: -``` +```text 帮我创建一个账号 team-frontend,权限级别 developer,可以访问 frontend 命名空间 帮我生成 team-frontend 的安装 Prompt ``` diff --git a/src/content/docs/ai-ml/ai-copilot/tke-skill.md b/src/content/docs/ai-ml/ai-copilot/tke-skill.md index 8113bb7..648cf08 100644 --- a/src/content/docs/ai-ml/ai-copilot/tke-skill.md +++ b/src/content/docs/ai-ml/ai-copilot/tke-skill.md @@ -145,13 +145,13 @@ RBAC 租户管理支持 4 种预定义角色: **使用 TKE Skill**: -``` +```text 帮我部署一个"你好,猴哥"静态页面到 TKE 集群 ``` AI 将自动完成: -``` +```text ✅ 分析需求,设计部署方案 ✅ 编写 Deployment、Service、ConfigMap 等 YAML ✅ 执行 kubectl apply 部署资源 @@ -184,14 +184,14 @@ AI 将自动完成: **使用 TKE Skill**: -``` +```text 帮我检查 my-app 为什么部署失败 分析 Pod 状态、查看日志、排查问题原因 ``` AI 将自动执行排障流程: -``` +```text 🔍 正在分析 Pod 状态... 📋 发现问题 Pod: my-app-7d9f8b6c5d-xxxxx @@ -230,7 +230,7 @@ AI 帮你写完代码、部署上线后,运维才刚刚开始。我们计划 #### 自动伸缩配置 -``` +```text 给 my-app 配置自动伸缩,CPU 超过 70% 就扩容,最多 10 个副本 ``` @@ -241,7 +241,7 @@ AI 自动配置 HPA: #### 故障自愈 -``` +```text 给 my-app 配置故障自愈,应用挂了自动重启 ``` @@ -252,12 +252,12 @@ AI 自动配置: #### 资源优化建议 -``` +```text 分析 my-app 最近 7 天的资源使用情况,看看配置是否合理 ``` AI 分析后给出建议: -``` +```text 📊 my-app 资源分析报告(过去 7 天) CPU: @@ -275,7 +275,7 @@ CPU: #### 灰度发布 -``` +```text 把 my-app 更新到 v2 版本,先灰度 10% 流量 ``` diff --git a/src/content/docs/ai-ml/ai-copilot/user-stories.md b/src/content/docs/ai-ml/ai-copilot/user-stories.md index eb9cb42..0d90245 100644 --- a/src/content/docs/ai-ml/ai-copilot/user-stories.md +++ b/src/content/docs/ai-ml/ai-copilot/user-stories.md @@ -49,7 +49,7 @@ title: "TKE Skill 使用场景指南" ### AI 执行步骤 -``` +```text 1. 查询所有可用集群,了解集群全貌 - 列出集群名称、版本、节点数、状态 - 识别出运行中的集群 @@ -87,7 +87,7 @@ title: "TKE Skill 使用场景指南" ### 预期输出示例 -``` +```text ================================================================================ 🎯 TKE 集群接入向导 ================================================================================ @@ -145,7 +145,7 @@ SRE 需要定期(每天/每周)对集群进行巡检: ### AI 执行步骤 -``` +```text 1. 获取所有集群列表 2. 对每个集群进行健康检查: @@ -187,7 +187,7 @@ SRE 需要定期(每天/每周)对集群进行巡检: ### 预期输出示例 -``` +```text ================================================================================ 📊 TKE 集群巡检报告 ================================================================================ @@ -240,7 +240,7 @@ SRE 需要定期(每天/每周)对集群进行巡检: ### AI 执行步骤 -``` +```text 1. 盘点 VPC 资源 - 列出所有 VPC - 统计每个 VPC 的子网数量和可用 IP @@ -283,7 +283,7 @@ SRE 需要定期(每天/每周)对集群进行巡检: ### 预期输出示例 -``` +```text ================================================================================ 📐 TKE 集群环境规划报告 ================================================================================ @@ -353,7 +353,7 @@ SRE 需要定期(每天/每周)对集群进行巡检: ### AI 执行步骤 -``` +```text 1. 验证集群存在且运行中 - 查询集群状态 - 如果不存在:提示集群 ID 错误 @@ -388,7 +388,7 @@ SRE 需要定期(每天/每周)对集群进行巡检: ### 预期输出示例 -``` +```text ================================================================================ 🔍 TKE 集群访问故障诊断 ================================================================================ @@ -453,7 +453,7 @@ SRE 需要定期(每天/每周)对集群进行巡检: ### AI 执行步骤 -``` +```text 1. 获取所有集群信息 - 基本配置(版本、类型、运行时) - 节点数量和规格 @@ -504,7 +504,7 @@ SRE 需要定期(每天/每周)对集群进行巡检: ### AI 执行步骤 -``` +```text 1. 获取集群当前配置 - 所在 VPC、子网、可用区 - 当前节点数量 @@ -558,7 +558,7 @@ SRE 需要定期(每天/每周)对集群进行巡检: ### AI 执行步骤 -``` +```text 1. 检查 TCR 实例 - 列出所有 TCR 实例 - 检查实例状态 @@ -604,7 +604,7 @@ TKE Skill v2.0 的多租户 RBAC 管理功能,可以将这三个问题一次 ### AI 执行步骤 -``` +```text 1. 解析用户权限需求 - 租户名称(如 team-frontend) - 目标命名空间(如 frontend, frontend-staging) @@ -645,7 +645,7 @@ TKE Skill v2.0 的多租户 RBAC 管理功能,可以将这三个问题一次 **管理员创建租户:** -``` +```text 管理员:帮我创建一个账号 team-frontend,权限级别 developer,可以访问 frontend 命名空间 Agent: @@ -673,7 +673,7 @@ Agent: **管理员生成安装 Prompt:** -``` +````text 管理员:帮我生成 team-frontend 的安装 Prompt Agent: @@ -717,11 +717,11 @@ export KUBECONFIG=~/.kube/tke-tenant-team-frontend.config kubectl get pods -n frontend ``` --- -``` +```` **租户使用 Agent:** -``` +```text 租户:帮我查看 frontend 命名空间的 Pod 状态 Agent: @@ -764,7 +764,7 @@ Agent: ### AI 执行步骤 -``` +```text 1. 分析部署需求 - 识别应用类型(静态页面/Web 应用/后端服务) - 确定目标集群和命名空间 @@ -800,7 +800,7 @@ Agent: ### 预期输出示例 -``` +```text 用户:帮我部署一个"你好,猴哥"静态页面到 TKE 集群 Agent: @@ -859,7 +859,7 @@ Agent: ### AI 执行步骤 -``` +```text 1. 获取 Pod 状态 - kubectl get pods - 识别异常 Pod(Pending/CrashLoopBackOff/Error) @@ -895,7 +895,7 @@ Agent: ### 预期输出示例 -``` +```text 用户:帮我检查 my-app 为什么部署失败 Agent: diff --git a/src/content/docs/ai-ml/kitops/best-practices.md b/src/content/docs/ai-ml/kitops/best-practices.md index 459c4c9..6c4d2da 100644 --- a/src/content/docs/ai-ml/kitops/best-practices.md +++ b/src/content/docs/ai-ml/kitops/best-practices.md @@ -19,7 +19,7 @@ title: "最佳实践" 推荐的 ML 项目目录结构,确保 Kitfile 能够正确打包所有组件: -``` +```text my-ml-project/ ├── Kitfile # ModelKit 配置文件(必需) ├── VERSION # 版本号文件 @@ -123,7 +123,7 @@ docs: 遵循 [Semantic Versioning 2.0.0](https://semver.org/): -``` +```text MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD] 示例: diff --git a/src/content/docs/ai-ml/opea/chatqna-deployment.md b/src/content/docs/ai-ml/opea/chatqna-deployment.md index 2f3686c..fbf9447 100644 --- a/src/content/docs/ai-ml/opea/chatqna-deployment.md +++ b/src/content/docs/ai-ml/opea/chatqna-deployment.md @@ -404,7 +404,7 @@ python cookbook/cluster/delete_cluster.py \ 以下是供 AI Agent 使用的提示词模板: -``` +```text 请在 TKE 上部署 OPEA ChatQnA 应用。 要求: diff --git a/src/content/docs/ai-ml/opea/quickstart.md b/src/content/docs/ai-ml/opea/quickstart.md index 2f05cee..3daa162 100644 --- a/src/content/docs/ai-ml/opea/quickstart.md +++ b/src/content/docs/ai-ml/opea/quickstart.md @@ -55,7 +55,7 @@ kubectl wait --for=condition=ready pod \ 预期输出: -``` +```text NAME READY STATUS RESTARTS AGE chatqna-redis-xxx 1/1 Running 0 2m chatqna-embedding-xxx 2/2 Running 0 2m diff --git a/src/content/docs/ai-ml/openclaw/architecture.md b/src/content/docs/ai-ml/openclaw/architecture.md index 6dddc50..76d27ed 100644 --- a/src/content/docs/ai-ml/openclaw/architecture.md +++ b/src/content/docs/ai-ml/openclaw/architecture.md @@ -38,7 +38,7 @@ title: "OpenClaw on TKE 架构方案" ### 架构设计 -``` +```text ┌──────────────────────────────────────────────────────────────┐ │ 企业微信/飞书/钉钉 │ │ 用户访问入口 │ @@ -225,7 +225,7 @@ title: "OpenClaw on TKE 架构方案" ### 架构设计 -``` +```text ┌──────────────────────────────────────────────────────────────┐ │ 企业微信/飞书/钉钉 │ │ 用户访问入口 │ diff --git a/src/content/docs/ai-ml/openclaw/elasticity.md b/src/content/docs/ai-ml/openclaw/elasticity.md index 54d6f1a..655cf30 100644 --- a/src/content/docs/ai-ml/openclaw/elasticity.md +++ b/src/content/docs/ai-ml/openclaw/elasticity.md @@ -33,7 +33,7 @@ resources: 基于 48C192G 标准节点: -``` +```text 可运行 Pod 数 = min( 48C / 0.2C = 240, 192G / 800M = 240 @@ -89,7 +89,7 @@ sequenceDiagram 由于用户活跃度不均,实际资源占用约为理论值的 20-30%: -``` +```text 理论资源 = 100万 Pod × 1C2G = 100万C 200万G 实际资源 = 100万 Pod × 0.2C0.8G × 30% = 6万C 24万G ``` diff --git a/src/content/docs/ai-ml/openclaw/storage.md b/src/content/docs/ai-ml/openclaw/storage.md index f7d7d42..bb4ba0a 100644 --- a/src/content/docs/ai-ml/openclaw/storage.md +++ b/src/content/docs/ai-ml/openclaw/storage.md @@ -62,7 +62,7 @@ spec: 通过增加节点数量分散单节点挂载压力: -``` +```text 节点数 = 总 Pod 数 / 单节点 Pod 上限 例:10万 Pod / 300 Pod/节点 = 334 节点 ``` diff --git a/src/content/docs/basics/supernode/03-delete-supernode.md b/src/content/docs/basics/supernode/03-delete-supernode.md index f2f088e..91f7f1c 100644 --- a/src/content/docs/basics/supernode/03-delete-supernode.md +++ b/src/content/docs/basics/supernode/03-delete-supernode.md @@ -181,7 +181,7 @@ kubectl get node eklet-subnet-xxxxxxxx-0 **期望结果**: -``` +```text Error from server (NotFound): nodes "eklet-subnet-xxxxxxxx-0" not found ``` diff --git a/src/content/docs/best-practices/availability/apiserver-rate-limiting.md b/src/content/docs/best-practices/availability/apiserver-rate-limiting.md index 1718fad..25b6ef5 100644 --- a/src/content/docs/best-practices/availability/apiserver-rate-limiting.md +++ b/src/content/docs/best-practices/availability/apiserver-rate-limiting.md @@ -37,7 +37,7 @@ OpenAI 等超大规模集群,因变更 DaemonSet 触发业务异常 list 请 6. **计算 APF 规则的 seats 数**:例如这组 APF 规则的并发权重和份额是 10,即 `spec.limited.assuredConcurrencyShares` 中配置了 10,那这组 APF 规则获得总 seats 数: - ``` + ```text seats = (max-requests-inflight + max-mutating-requests-inflight) * 10 / (10 + 245) ``` @@ -45,7 +45,7 @@ OpenAI 等超大规模集群,因变更 DaemonSet 触发业务异常 list 请 ### 计算公式 -``` +```text NominalCL(i) = ceil(ServerCL * NCS(i) / SUM_NCS) ``` @@ -418,7 +418,7 @@ spec: PriorityLevelConfiguration 中 `spec.limited.nominalConcurrencyShares` 最小并发份额可以设置为 1,同时 FlowSchema 中 `subjects.userAgent.nameRegexp` 中配置正则来拦截系统组件之外的 list 请求: -``` +```text ^(?!kube-scheduler|kube-apiserver|kubelet|kube-controller-manager|service-controller|tke-eni-ipamd|coredns|csi-provisioner|csi-attacher|csi-snapshotter|csi-resizer|tencent-cloud-controller-manager|gatekeeper|cluster-autoscaler|add-pod-eni-ip-limit-webhook|machine-apiserver|qcloud_ingress|kubectl).* ``` @@ -480,7 +480,7 @@ spec: PriorityLevelConfiguration 中 `spec.limited.nominalConcurrencyShares` 最小并发份额可以设置为 1。同时 FlowSchema 中 `subjects.userAgent.nameRegexp` 中配置以下正则来拦截所有 list 请求: -``` +```text ^(?!kubectl).* ``` @@ -549,13 +549,13 @@ spec: 压测工具会命中 APF 默认的 FlowSchema `service-accounts`,对应 PriorityLevelConfiguration `workload-low` -``` +```yaml nominalConcurrencyShares: 100 ``` `workload-low` 计算出可分配 seats 数为: -``` +```text ((200 + 400) / 245) * 100 = 245 ``` @@ -571,13 +571,13 @@ nominalConcurrencyShares: 100 下发增强版限速后,list 请求命中 FlowSchema `a-fs-demo` 对应 PriorityLevelConfiguration `plc-demo` -``` +```yaml nominalConcurrencyShares: 1 ``` `plc-demo` 计算出可分配 seats 数为: -``` +```text ((200 + 400) / 246) * 1 = 3 ``` diff --git a/src/content/docs/best-practices/availability/etcd-overload-protection.md b/src/content/docs/best-practices/availability/etcd-overload-protection.md index d7a6ced..e50176b 100644 --- a/src/content/docs/best-practices/availability/etcd-overload-protection.md +++ b/src/content/docs/best-practices/availability/etcd-overload-protection.md @@ -230,7 +230,7 @@ kubectl get --raw /metrics | grep request_match_config_sync_counter 业务集群因异常 list pod 出现 API Server CPU 高负载和 etcd 流量告警: -``` +```text [ETCD告警][2025-04-01 06:06:39][ETCD出流量超过阀值,集群名:cls-xxxxxxxx, 当前流量大小:240.051MB ``` @@ -238,7 +238,7 @@ kubectl get --raw /metrics | grep request_match_config_sync_counter 查看 API Server 慢查询日志,确定 userAgent: -``` +```text I0401 06:47:07.032841 1 trace.go:219] Trace[1893148101]: "List" accept:application/json, */*,audit-id:223398123-0b6c-4743-9c62-124,client:172.10.24.12,protocol:HTTP/2.0,resource:pods,scope:namespace,url:/api/v1/namespaces/infer/pods,user-agent: okhttp/v3.12 (linux/amd64) kubernetes/$Format/admin,verb:LIST (01-Apr-2025 06:47:06.490) (total time: 1542ms): ``` diff --git a/src/content/docs/best-practices/control-plane/upgrade.md b/src/content/docs/best-practices/control-plane/upgrade.md index 7fd1c97..d3d867e 100644 --- a/src/content/docs/best-practices/control-plane/upgrade.md +++ b/src/content/docs/best-practices/control-plane/upgrade.md @@ -305,7 +305,7 @@ kubectl version --short **期望结果**: -``` +```text Server Version: v1.28.3 ``` @@ -317,7 +317,7 @@ kubectl get nodes -o wide **期望结果**: -``` +```text NAME STATUS ROLES AGE VERSION INTERNAL-IP OS-IMAGE node-01 Ready 30d v1.28.3 10.0.0.1 Tencent tlinux node-02 Ready 30d v1.28.3 10.0.0.2 Tencent tlinux diff --git a/src/content/docs/best-practices/security/cluster-hardening.md b/src/content/docs/best-practices/security/cluster-hardening.md index 876e774..0b2edd4 100644 --- a/src/content/docs/best-practices/security/cluster-hardening.md +++ b/src/content/docs/best-practices/security/cluster-hardening.md @@ -269,7 +269,7 @@ resource "tencentcloud_kubernetes_cluster" "cluster" { 对于需要访问外网的场景,使用 NAT 网关: -``` +```text ┌─────────────────────────────────────────────────────┐ │ VPC │ │ ┌─────────────┐ ┌─────────────────────────────┐│ @@ -633,7 +633,7 @@ spec: image: untrusted-image:v1 ``` -``` +```text 普通容器: ┌─────────────────────────────────────┐ │ 应用进程 │ diff --git a/src/content/docs/best-practices/security/compliance-and-audit.md b/src/content/docs/best-practices/security/compliance-and-audit.md index e321d45..54d0184 100644 --- a/src/content/docs/best-practices/security/compliance-and-audit.md +++ b/src/content/docs/best-practices/security/compliance-and-audit.md @@ -30,7 +30,7 @@ title: "合规与审计最佳实践" ### 审计数据流 -``` +```text ┌─────────────────────────────────────────┐ │ 操作入口 │ │ - kubectl / API 调用 │ diff --git a/src/content/docs/best-practices/security/data-security.md b/src/content/docs/best-practices/security/data-security.md index ca128a1..3e83926 100644 --- a/src/content/docs/best-practices/security/data-security.md +++ b/src/content/docs/best-practices/security/data-security.md @@ -30,7 +30,7 @@ title: "数据安全最佳实践" ### 数据安全分层模型 -``` +```text ┌─────────────────────────────────────────┐ │ 应用层数据安全 │ │ - 应用层加密 │ diff --git a/src/content/docs/best-practices/security/network-security.md b/src/content/docs/best-practices/security/network-security.md index 16975ec..29355de 100644 --- a/src/content/docs/best-practices/security/network-security.md +++ b/src/content/docs/best-practices/security/network-security.md @@ -29,7 +29,7 @@ title: "网络安全最佳实践" ### 网络隔离层次 -``` +```text ┌─────────────────────────────────────────┐ │ 云基础设施层 (VPC/子网) │ │ - VPC 隔离 │ diff --git a/src/content/docs/best-practices/security/policy-management.md b/src/content/docs/best-practices/security/policy-management.md index 6532e8e..7a63af1 100644 --- a/src/content/docs/best-practices/security/policy-management.md +++ b/src/content/docs/best-practices/security/policy-management.md @@ -509,7 +509,7 @@ kubectl apply -f test-privileged-pod.yaml **期望结果**(策略为 deny 模式时): -``` +```text Error from server (Forbidden): error when creating "test-privileged-pod.yaml": admission webhook "validation.gatekeeper.sh" denied the request: [psp-privileged-container] Privileged container is not allowed: privileged-container @@ -549,7 +549,7 @@ kubectl get pods -n gatekeeper-system **期望结果**: -``` +```text NAME READY STATUS RESTARTS AGE gatekeeper-audit-xxxxxxxxxx-xxxxx 1/1 Running 0 1d gatekeeper-controller-manager-xxxxxxxxxx-xxxxx 1/1 Running 0 1d diff --git a/src/content/docs/best-practices/upgrade/index.md b/src/content/docs/best-practices/upgrade/index.md index f4343b7..129104a 100644 --- a/src/content/docs/best-practices/upgrade/index.md +++ b/src/content/docs/best-practices/upgrade/index.md @@ -94,7 +94,7 @@ kubectl-check-ownerreferences 如果检查结果如下,则表明集群内没有异常 ownerReference 引用: -``` +```text No invalid ownerReferences found ``` @@ -166,7 +166,7 @@ TKE 目前在集群升级时,组件版本要求如下: 例如:搜索 1.25 要被废弃的 v1beta1 的 poddisruptionbudgets 示例: -``` +```text requestURI:policy/v1beta1/poddisruptionbudgets ``` @@ -196,7 +196,7 @@ kubent -k /root/.kube/config ##### 3.4.2.3 预期结果 -``` +```text _____________________________________________________________________________ >>> Deprecated APIs removed in 1.25 <<< ------------------------------------------------------------------------------------------ diff --git a/src/content/docs/posts/2026/tke-skill-ai-copilot-practice.md b/src/content/docs/posts/2026/tke-skill-ai-copilot-practice.md index bafb11d..16c676c 100644 --- a/src/content/docs/posts/2026/tke-skill-ai-copilot-practice.md +++ b/src/content/docs/posts/2026/tke-skill-ai-copilot-practice.md @@ -13,7 +13,7 @@ description: 记录使用 TKE Skill 和 kubernetes-mcp-server 部署项目到 TK 理想场景是这样的: -``` +```text 用户: 把当前项目部署到 TKE 集群 cls-xxx AI: 好的,已完成部署!访问地址是 http://x.x.x.x ``` @@ -78,13 +78,13 @@ export TENCENTCLOUD_SECRET_KEY="xxx" 我信心满满地说: -``` +```text 把 TKE Workshop 项目部署到集群 cls-1l0io2fu ``` 然后... AI 开始了它的"自主发挥": -``` +```text AI 执行流程: 1. [TKE Skill] 获取 kubeconfig ✅ 2. [保存文件] 把 kubeconfig 写到本地 ✅ @@ -112,7 +112,7 @@ AI 执行流程: 举个例子: -``` +```text TKE Skill 获取的 kubeconfig: → AI 需要自己决定保存到哪个路径 → kubernetes-mcp 需要读取这个路径 @@ -141,7 +141,7 @@ TKE Skill 获取的 kubeconfig: ### 问题 2:kubeconfig 流转不顺畅 -``` +```text TKE Skill: 这是 kubeconfig 内容 AI: 我保存到 ~/.kube/config...(自己决定的) kubernetes-mcp: 我默认读 ~/.kube/config...(可能不一致) @@ -151,7 +151,7 @@ kubernetes-mcp: 我默认读 ~/.kube/config...(可能不一致) ### 问题 3:镜像构建/推送是断点 -``` +```text 项目代码 → [构建镜像] → [推送镜像] → [部署到 K8s] ❌ 没有自动化 ❌ 没有自动化 ``` @@ -263,7 +263,7 @@ tke tcr-push --image xxx --namespace xxx **用户装好 TKE Skill 后,应该能直接说:** -``` +```text 把当前项目部署到 TKE 集群 cls-xxx ``` diff --git a/tmp/tke-skill-k8s-mcp-integration.md b/tmp/tke-skill-k8s-mcp-integration.md index 4f5d442..652c5c5 100644 --- a/tmp/tke-skill-k8s-mcp-integration.md +++ b/tmp/tke-skill-k8s-mcp-integration.md @@ -22,7 +22,7 @@ ### 整体架构 -``` +```text ┌──────────────────────────────────────────────────────────────────────────┐ │ AI Agent (CodeBuddy / Claude) │ │ ┌────────────────────────────────────────────────────────────────────┐ │ @@ -65,7 +65,7 @@ ### 数据流 -``` +```text 用户请求: "把当前项目部署到广州的 TKE 集群" │ ▼ @@ -283,7 +283,7 @@ pods = k8s_mcp.pods_list( #### 架构 -``` +```text ┌───────────────────────────────────────────────────────────────┐ │ TKE Skill (Enhanced) │ ├───────────────────────────────────────────────────────────────┤ @@ -446,7 +446,7 @@ function routeRequest(userRequest: string): ToolChain { ### kubeconfig 传递流程 -``` +```text ┌─────────────────────────────────────────────────────────────────┐ │ TKE Skill │ │ ┌─────────────────────────────────────────────────────────────┐ │ @@ -515,7 +515,7 @@ function routeRequest(userRequest: string): ToolChain { #### 场景 1: 一句话部署应用 -``` +```text 用户: "把当前项目部署到广州 TKE 集群 cls-abc123" 执行流程: @@ -539,7 +539,7 @@ function routeRequest(userRequest: string): ToolChain { #### 场景 2: Pod Pending 排障 -``` +```text 用户: "集群 cls-abc123 有 Pod 一直 Pending,帮我看看" 执行流程: @@ -570,7 +570,7 @@ function routeRequest(userRequest: string): ToolChain { #### 场景 3: Helm 应用安装 -``` +```text 用户: "在 cls-abc123 集群安装 nginx-ingress" 执行流程: