feat(cluster): 接入深圳专用 Worker 节点

新增深圳 K3s agent 与四节点 WireGuard 全互联接入脚本,将深圳归入香港逻辑 Worker 池并用污点限制为 Worker 专用。\n\n生产验收支持宁波 0、香港逻辑池 2 的双物理节点基线,补充副本拓扑分散、容量档位、链路巡检和零副本站点校验。\n\n已通过 Go 全量测试、go vet、govulncheck、迁移安全检查、ShellCheck、发布脚本测试、前后端 lint/test/build、Compose 与 Kubernetes 渲染校验。
This commit is contained in:
2026-08-01 09:38:10 +08:00
parent 132cda35d8
commit 70b0ffb9ae
12 changed files with 539 additions and 87 deletions
@@ -140,12 +140,17 @@ pool_saturated_pods() {
check_wireguard() {
local -a hosts=("$CLUSTER_NINGBO_HOST" "$CLUSTER_HONGKONG_HOST" "$CLUSTER_LOS_ANGELES_HOST")
local -a ips=(10.77.0.1 10.77.0.2 10.77.0.3)
local source target output loss average handshakes
for source in 0 1 2; do
[[ -z $CLUSTER_SHENZHEN_HOST ]] || {
hosts+=("$CLUSTER_SHENZHEN_HOST")
ips+=(10.77.0.4)
}
local source target output loss average handshakes peer_count
peer_count=$((${#hosts[@]} - 1))
for source in "${!hosts[@]}"; do
handshakes=$(cluster_ssh "${hosts[$source]}" \
"wg show wg0 latest-handshakes | awk '\$2 > 0 && systime()-\$2 < 180 {count++} END {print count+0}'")
(( handshakes == 2 )) || return 1
for target in 0 1 2; do
(( handshakes == peer_count )) || return 1
for target in "${!hosts[@]}"; do
(( source == target )) && continue
output=$(cluster_ssh "${hosts[$source]}" "ping -q -c 10 -W 2 ${ips[$target]}") || return 1
loss=$(awk -F',' '/packet loss/ {gsub(/[^0-9.]/,"",$3); print $3}' <<<"$output")