- 后端: GetNodeDetail handler — 获取单个节点完整信息 * 系统信息: container_runtime/architecture/kubelet/os/kernel * 资源分配率: 遍历 Pod 计算 CPU/Memory/Pods requested vs allocatable * metrics-server 数据注入 (cpu_usage_m/mem_usage_mi) * 全量 conditions/taints/labels + 节点上的 Pod 列表 - 后端: K8s 客户端扩展 * NodeTaint/NodeCondition 扩展字段 (reason/message) * NodeInfo 增加 architecture/operatingSystem * GetNode(name) 单节点查询方法 * parseCpuToMilli()/parseMemToMi() 资源解析辅助函数 - 后端: 注册路由 * GET /kubernetes/:clusterCode/nodes/:name (Kuboard code) * GET /kubernetes-clusters/:id/nodes/:name (ID) - 前端: NodeDetailPage.tsx (~330行) * 系统信息卡片 + 资源分配率卡片(进度条) * 条件卡片 + 污点卡片 + 标签卡片 + Pod 列表 - 前端: 节点名称可点击跳转 (ClusterOverviewPage) - 验证: API/SPA/TS/Vite 全部通过
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
services:
|
|
# ======================== Go 后端服务 (连接外部 MySQL/Redis) ========================
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: backend/Dockerfile
|
|
args:
|
|
VERSION: ${VERSION:-dev}
|
|
BUILD_TIME: ${BUILD_TIME:-unknown}
|
|
container_name: aiops-backend
|
|
hostname: aiops-backend
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- ./backend/config.external.yaml:/app/config.yaml
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
networks:
|
|
- aiops-network
|
|
|
|
# ======================== React 前端 + Nginx ========================
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
container_name: aiops-frontend
|
|
hostname: aiops-frontend
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
networks:
|
|
- aiops-network
|
|
|
|
networks:
|
|
aiops-network:
|
|
driver: bridge
|