Kubernetes 集群管理 Dashboard,提供直观的 Web 界面管理 Kubernetes 核心资源。
kubeagent/
├── backend/ # Go 后端服务
│ ├── cmd/ # 应用入口
│ ├── config/ # 配置文件
│ ├── internal/ # 内部代码
│ │ ├── config/ # 配置管理
│ │ ├── handler/ # HTTP 处理器
│ │ ├── kubernetes/ # K8s 客户端
│ │ ├── middleware/ # 中间件
│ │ ├── model/ # 数据模型
│ │ └── service/ # 业务逻辑
│ ├── pkg/ # 公共工具
│ └── router/ # 路由配置
├── frontend/ # React 前端应用
│ ├── src/ # 源代码
│ └── public/ # 静态资源
└── README.md
- Go 1.21+ - 编程语言
- Gin - Web 框架
- client-go - Kubernetes 官方 Go 客户端
- Viper - 配置管理
- React 19 - UI 框架
- TypeScript - 类型安全
- Vite - 构建工具
- Tailwind CSS 4 - 样式框架
- Radix UI - 无障碍组件原语
- TanStack Query - 服务端状态管理
- React Router - 路由管理
- Axios - HTTP 客户端
- 集群信息查看(节点、版本等)
- Namespace 管理
- Pod 管理(查看、删除、日志)
- Deployment 管理(CRUD、重启)
- Service 管理
- ConfigMap 管理
- Secret 管理(敏感数据保护)
- Go 1.21+
- Node.js 18+
- Kubernetes 集群访问权限(kubeconfig 或 in-cluster)
cd backend
# 安装依赖
go mod tidy
# 启动服务
go run cmd/server/main.go后端服务运行在 http://localhost:8080
cd frontend
# 安装依赖
npm install
# 启动开发服务器
npm run dev前端开发服务器运行在 http://localhost:5173
server:
port: 8080 # 服务端口
mode: debug # 运行模式: debug, release, test
kube:
mode: auto # 连接模式: in-cluster, kubeconfig, auto
kubeconfigPath: "" # kubeconfig 路径,留空使用默认 ~/.kube/config
logLevel: info # 日志级别| 模式 | 说明 | 适用场景 |
|---|---|---|
in-cluster |
使用 ServiceAccount 认证 | 服务部署在 K8s 集群内 |
kubeconfig |
使用 kubeconfig 文件 | 本地开发、外部访问 |
auto |
自动检测(默认) | 优先 in-cluster,失败回退 kubeconfig |
详细 API 文档请参考 backend/README.md
| 资源 | 接口前缀 |
|---|---|
| 集群信息 | /api/v1/cluster |
| Namespace | /api/v1/namespaces |
| Pod | /api/v1/namespaces/:namespace/pods |
| Deployment | /api/v1/namespaces/:namespace/deployments |
| Service | /api/v1/namespaces/:namespace/services |
| ConfigMap | /api/v1/namespaces/:namespace/configmaps |
| Secret | /api/v1/namespaces/:namespace/secrets |
# 后端
cd backend && go build -o bin/server ./cmd/server
# 前端
cd frontend && npm run build# 后端
cd backend && go vet ./...
# 前端
cd frontend && npm run lintMIT