这是一个节点离线自动上下线的控制器,目前支持 K8s、KubeEdge 的节点上下线。
- 单节点管理 (NodeDeploy): 通过 NodeDeploy CRD 管理单个节点的上下线
- 批量节点管理 (NodePool): 通过 NodePool CRD 批量管理多个节点
- 节点类型支持: 支持 K8s Worker 节点和 KubeEdge 边缘节点
- SSH 远程执行: 通过 SSH 连接到目标节点执行离线安装
- 重试机制: 支持配置最大重试次数
- 状态监控: 实时监控节点状态,支持超时回退
helm upgrade --install node-deploy node-deploy -n controller --create-namespace
apiVersion: node.nodedeploy/v1
kind: NodeDeploy
metadata:
name: nodedeploy-sample
namespace: controller
spec:
nodeName: "k8s-worker-1"
nodeIP: "192.168.28.142"
nodeType: "work"
nodePort: "22"
nodeUser: "root"
nodePwd: "YourPassword"
harborEndpoint: "http://192.168.28.130:30003"
harborUser: "admin"
harborPwd: "Harbor12345"
nodeVersion: "1.21.14"
labels:
node-role: worker
annotations:
desc: "worker node"
taints:
- key: "dedicated"
value: "worker"
effect: "NoSchedule"
nodeStatus: "active"
maxRetry: 3
apiVersion: node.nodedeploy/v1
kind: NodePool
metadata:
name: worker-pool
namespace: controller
spec:
nodeIPs:
- "192.168.1.101"
- "192.168.1.102"
- "192.168.1.103"
nodeType: "work"
nodePort: "22"
nodeUser: "root"
nodePwd: "YourPassword"
harborEndpoint: "http://192.168.1.100:30003"
harborUser: "admin"
harborPwd: "Harbor12345"
nodeVersion: "1.21.14"
labels:
node-role: worker
namePrefix: "worker-"
nameIndexStart: 1
apiVersion: node.nodedeploy/v1
kind: NodePool
metadata:
name: worker-pool-manual
namespace: controller
spec:
nodeIPs:
- "192.168.1.101"
- "192.168.1.102"
- "192.168.1.103"
nodeNameMapping:
"192.168.1.101": "worker-01"
"192.168.1.102": "worker-02"
"192.168.1.103": "worker-03"
nodeType: "work"
nodePort: "22"
nodeUser: "root"
nodePwd: "YourPassword"
nodeVersion: "1.21.14"
labels:
node-role: worker
| 字段 |
类型 |
描述 |
nodeName |
string |
节点名称 |
nodeIP |
string |
节点 IP |
nodeType |
string |
节点类型: work / kubeedge |
nodePort |
string |
SSH 端口 |
nodeUser |
string |
SSH 用户 |
nodePwd |
string |
SSH 密码 |
harborEndpoint |
string |
Harbor 地址 |
harborUser |
string |
Harbor 用户 |
harborPwd |
string |
Harbor 密码 |
nodeVersion |
string |
K8s 版本 |
labels |
map |
节点标签 |
annotations |
map |
节点注解 |
taints |
array |
节点污点 |
nodeStatus |
string |
目标状态: active / inactive |
maxRetry |
int |
最大重试次数 |
| 字段 |
类型 |
描述 |
nodeIPs |
array |
节点 IP 列表 |
nodeNameMapping |
map |
节点名称映射 (可选) |
nodeType |
string |
节点类型 |
namePrefix |
string |
节点名称前缀 (自动命名模式) |
nameIndexStart |
int |
起始编号 (自动命名模式) |
- 2024.4.3 镜像:piwriw/nodedeploy-controller:0.1 支持 K8s 1.21.14 node 节点上下线
- 2024.4.3 镜像:piwriw/nodedeploy-controller:kubeeedge-0.1 仅支持 kubeedge 节点上下线
- 2024.4.3 镜像:piwriw/nodedeploy-controller:0.2 支持 K8s 1.21.14 node 节点上下线和支持 kubeedge 1.12.3 节点上下线
- 2024.4.3 镜像:piwriw/nodedeploy-controller:0.3 优化:使用集群内认证 token
- 2024.4.7 镜像:piwriw/nodedeploy-controller:0.4 增强:支持 Retry,重试次数
- 2026.3.7 新增:NodePool CRD,支持批量节点管理