Files
aiops/PROJECT_EVALUATION.md
T
attacker 4f1ffd1275 feat(k8s): M2 Pod Metrics 详情页接入 — ListPods 注入 metrics
后端:
- 新增 buildPodMetricsMap() 公共辅助函数,聚合多容器 CPU/Memory
- ListPods / listPodsWithNS / ListPodsAllNS 三个 handler 全部注入
- PodSummary 增加 cpu_usage_m / mem_usage_mi 字段

前端:
- KubernetesWorkloads Pod 表格增加 CPU/内存列
- NamespaceResourcePage Pod 表格增加 CPU/内存列

验证:
- 17 个 Pod 全部返回真实 metrics (argocd/demo-jar)
- curl /kubernetes-clusters/1/pods → cpu_usage_m='2m' mem_usage_mi='61Mi'

文档:
- ROADMAP M1→done, M2→done, 验收标准全部勾选
- TDD_PLAN M2 通过标准补充
- PROJECT_EVALUATION P0 缺失项移除
2026-06-23 00:54:54 +08:00

54 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# K8s 管理功能评估基线
> 生成时间: 2026-06-21 | 评估人: Logan + AI
## 总体规模
| 层 | 规模 |
|----|------|
| 后端 `kubernetes.go` | 2583 行 / 99 个函数 / 74 个路由 |
| 后端 `kubernetesclient/client.go` | 1486 行 |
| 前端组件 | 22 个 .tsx / 7498 行 |
## 功能评估
### ✅ 已完成(90%)
| 功能 | 后端 | 前端 | 验证状态 |
|------|:----:|:----:|:--------:|
| 集群 CRUD + 同步 | ✅ | ✅ | ✅ 已验证 |
| 集群表单(名称即 code) | ✅ | ✅ NAME_RE 正则 | ✅ |
| 节点列表 + 实时 metrics | ✅ ListNodes 调 GetNodeMetrics | ✅ ClusterOverviewPage | ⚠️ 实时OK,DB缓存缺 |
| Pod 列表 | ✅ | ✅ | ✅ |
| Deployment 列表/详情 | ✅ | ✅ DeploymentView + DeploymentWorkload | ✅ |
| Deployment view/edit 路由 | ✅ | ✅ /:mode/:kind/:name | ✅ |
| Deployment 伸缩/重启/镜像更新 | ✅ scale/restart/update-image | ✅ | ✅ |
| Deployment 历史版本/回滚 | ✅ revisions/rollback | ✅ | ✅ |
| Pod 日志(实时流) | ✅ GetPodLogs | ✅ PodLogsViewer fetch stream | ✅ |
| Pod 终端 exec | ✅ ExecTerminal(WS) | ✅ PodExecTerminal bash/sh/ash | ✅ |
| Pod 文件浏览 + 下载 | ✅ files/list + files/download | ✅ PodFileBrowser | ✅ |
| YAML 查看/编辑 | ✅ GetYAML + UpdateYAML | ✅ YamlViewer | ✅ |
| ReplicaSet 列表 | ✅ | ✅ | ✅ |
| Service/Ingress 列表 | ✅ | ✅ | ✅ |
| HPA 列表/创建/删除 | ✅ | ✅ | ✅ |
| ConfigMap/Secret 列表 | ✅ | ✅ | ✅ |
| Events 列表 | ✅ ListEvents | ✅ EventsPage | ✅ |
| 容量分析 | ✅ GetCapacityAnalysis | ✅ CapacityPage | ✅ |
| kubectl 终端 | ✅ KubectlShell(WS) | ✅ KubectlTerminal | ✅ |
| 拓扑图 | ✅ topology get/save | ✅ TopologyView | ✅ |
### ❌ 缺失(10%)
| 功能 | 优先级 | 说明 |
|------|:------:|------|
| Pod 文件上传 | P2 | 只有下载,缺上传 |
| CI/CD 集成菜单项 | P3 | 菜单有按钮但未接线 |
| Deployment 暂停更新 | P3 | 菜单无此项 |
### ⚠️ 已知架构约束
1. **K8s 集群(161/162)是 CentOS 7** — MySQL 8.0 容器跑不了(x86-64-v2),用 hostNetwork + 外部 MySQL
2. **metrics-server 已安装** — `kubectl top nodes` 正常返回
3. **自研 K8s 客户端** — 不用 client-go,保持轻量 net/http 方案
4. **两个数据路径**:ListNodes 实时调 API(含 metrics),SyncCluster 写 DB(缺 metrics)→ 前端不同页面读不同路径