feat(k8s): M8+M9 存储挂载/高级设置/服务路由 Tab — Deployment 可视化编辑器 5 Tab 全部完成
M8 存储挂载 Tab (DeploymentEditStorage.tsx, 437行): - 6种数据卷类型: EmptyDir/HostPath/ConfigMap/Secret/PVC/NFS - 每种类型独立字段编辑 + volumeMounts 只读汇总 M8 高级设置 Tab (DeploymentEditAdvanced.tsx, 632行): - 更新策略(RollingUpdate/Recreate) + revisionHistoryLimit/progressDeadlineSeconds - 调度: nodeSelector + tolerations(key/operator/value/effect/tolerationSeconds) - DNS: dnsPolicy + dnsConfig(nameservers/searches/options) - 主机设置: hostNetwork/hostIPC/hostPID/shareProcessNamespace + hostAliases - Pod 安全上下文: runAsUser/runAsGroup/fsGroup/runAsNonRoot M9 服务路由 Tab (DeploymentEditService.tsx): - selector 双路径关联 Service(spec.selector.matchLabels || selector) - Service/Ingress 创建/删除集成 EditModeContainer 5 Tab 全部 available: basic / containers / storage / advanced / service 验证: go build OK + tsc --noEmit OK + vite build OK + SPA edit路由200 + YAML API有效
This commit is contained in:
1 parent
60934277ac
commit
28dfc519e1
10 files changed
+691
-665
No files matched your search
+67
@@ -226,3 +226,70 @@ curl -s http://127.0.0.1/ | grep -oP 'index-[A-Za-z0-9]+\.js'
|
||||
- [x] 每个容器可编辑:镜像/拉取策略/命令/参数/环境变量/端口/资源/健康检查/生命周期/安全上下文/卷挂载
|
||||
- [x] 镜像拉取凭证(imagePullSecrets) Pod 级别编辑
|
||||
- [x] 三种探针类型(httpGet/tcpSocket/exec)可切换
|
||||
|
||||
---
|
||||
|
||||
## M8: 存储挂载 + 高级设置 Tab
|
||||
|
||||
### 验证用例
|
||||
|
||||
```bash
|
||||
# U1: 登录获取 Token
|
||||
TOKEN=$(curl -s http://127.0.0.1:8080/api/v1/auth/login \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"username":"admin","password":"admin123"}' | jq -r '.data.token')
|
||||
|
||||
# U2: SPA fallback — edit 路由返回 200(非 301)
|
||||
curl -s -o /dev/null -w "%{http_code}" \
|
||||
"http://127.0.0.1/kubernetes/prod-cluster/namespace/devops/workload/edit/Deployment/redis"
|
||||
# 期望: 200
|
||||
|
||||
# U3: YAML GET API — Storage/Advanced Tab 数据源
|
||||
curl -s "http://127.0.0.1:8080/api/v1/kubernetes/prod-cluster/namespace/devops/deployments/redis/yaml" \
|
||||
-H "Authorization: Bearer $TOKEN" | head -5
|
||||
# 期望: apiVersion: apps/v1 / kind: Deployment / metadata:
|
||||
|
||||
# U4: TypeScript 编译 + Vite 构建
|
||||
cd frontend && npx tsc --noEmit && npm run build 2>&1 | tail -3
|
||||
# 期望: 零错误 + built in Ns
|
||||
|
||||
# U5: 前端 bundle 含 DeploymentEditStorage + DeploymentEditAdvanced 组件
|
||||
curl -s http://127.0.0.1/ | grep -oP 'index-[A-Za-z0-9]+\.js'
|
||||
# 期望: 新 hash(每次构建变化)
|
||||
```
|
||||
|
||||
### 通过标准
|
||||
- [x] U1: 登录成功
|
||||
- [x] U2: edit 路由 SPA fallback 返回 200
|
||||
- [x] U3: YAML API 返回含 spec.strategy/spec.template.spec 的有效 manifest
|
||||
- [x] U4: TypeScript 零编译错误 + Vite 构建成功
|
||||
- [x] U5: 前端 bundle 已更新
|
||||
- [x] DeploymentEditStorage 支持 6 种 volume 类型(EmptyDir/HostPath/ConfigMap/Secret/PVC/NFS)
|
||||
- [x] DeploymentEditAdvanced 支持更新策略/调度/nodeSelector/tolerations/DNS/安全上下文/主机设置/hostAliases/dnsConfig
|
||||
- [x] 各 Tab 独立保存(PUT application/yaml 直通 K8s API)
|
||||
|
||||
---
|
||||
|
||||
## M9: 服务/应用路由 Tab + 整体联调
|
||||
|
||||
### 验证用例
|
||||
|
||||
```bash
|
||||
# U1: 5 Tab 全部 available(检查 EditModeContainer)
|
||||
# 验证方式: 浏览器打开 edit 模式,5 个 Tab 均可点击切换
|
||||
|
||||
# U2: TypeScript 编译
|
||||
cd frontend && npx tsc --noEmit
|
||||
# 期望: 退出码 0
|
||||
|
||||
# U3: Vite 构建成功
|
||||
cd frontend && npm run build 2>&1 | tail -3
|
||||
# 期望: built in Ns
|
||||
```
|
||||
|
||||
### 通过标准
|
||||
- [x] DeploymentEditService.tsx 组件存在且编译通过
|
||||
- [x] DeploymentWorkload.tsx EditModeContainer 5 Tab 全部 available
|
||||
- [x] Service Tab selector 双路径兼容(spec.selector.matchLabels || selector)
|
||||
- [x] TypeScript 零编译错误 + Vite 构建成功
|
||||
- [x] 前端 bundle 已更新
|
||||
Reference in new issue
Block a user