feat: K8s 集群实时代理 — 直接调用 K8s API 不存储 MySQL
- 新增 pkg/k8sclient 轻量级 K8s REST 客户端(解析 kubeconfig TLS 证书) - ListNodes/Pods/Deployments/Services/Ingresses 改为实时代理 K8s API - 集群同步端点 POST /:id/sync(拉取后仍存 MySQL 用于离线缓存储备) - 前端 k8sApi 新增 syncCluster 方法 - 修复 SNMP MaxRepetitions uint8→uint32 类型错误 - 修复 ServicePort.TargetPort 兼容 int/string 双类型 - 创建 k8s_nodes/pods/deployments/services/ingresses 五张表
This commit is contained in:
1 parent
a1d4e2f18a
commit
b25ad8705f
6 files changed
+821
-53
No files matched your search
@@ -239,6 +239,7 @@ func Register(r *gin.Engine, db *gorm.DB, log *zap.Logger, cfg *config.Config, c
|
||||
clusters.POST("", k8sHandler.CreateCluster)
|
||||
clusters.PUT("/:id", k8sHandler.UpdateCluster)
|
||||
clusters.DELETE("/:id", k8sHandler.DeleteCluster)
|
||||
clusters.POST("/:id/sync", k8sHandler.SyncCluster) // 同步集群资源 // Logan.Li
|
||||
clusters.GET("/:id/nodes", k8sHandler.ListNodes)
|
||||
clusters.GET("/:id/pods", k8sHandler.ListPods)
|
||||
clusters.GET("/:id/deployments", k8sHandler.ListDeployments)
|
||||
|
||||
Reference in new issue
Block a user