Files
ssw-mvp/deploy/ucloud-uhost/setup-uhost.sh
T
admin 49aac795e9 feat(deploy/ucloud): UCloud UHost + k3s 部署资产 + scard connector 双架构重编
UCloud 一方节点部署:UHost 1C8G 按小时(0.3-0.5 元/时)+ k3s(rancher-mirror
源,避免 get.k3s.io 超时)+ UHub 私有镜像仓库(ssww/ssw-tdc:local、
ssw-nax:local),参与方在云端跟本地 OrbStack k8s 用同一套镜像。

新增资产:
- deploy/ucloud-uhost/lifecycle.py: UCloudAPI + K8sEnv,uhost 子命令
  (create/setup-k3s/build/push/up/smoke/stop/start/destroy)
- deploy/ucloud-uhost/setup-uhost.sh: k3s 单节点 control-plane 安装
- deploy/ucloud-uhost/smoke-tdc.sh: 7 步 lite-TDC 烟测
- deploy/k8s/{nax,tdc}-deploy.yaml: k3s 部署清单(lite-TDC + connector +
  easytier sidecar;nax HTTP 算子 Pod)
- deploy/k8s/ssw-tdc-pg-pvc.yaml: hostPath PV 5Gi for PG 数据持久化
  (/var/lib/ssw-tdc/pgdata)
- deploy/docs/UCloud_UHost_部署指南.md: 完整部署文档(凭证、API 坑、
  k3s 步骤、UHub 凭证、持久化)

scard 安全平面:
- connector-linux-amd64 (8.5MB -> 10.1MB): 重新编译(GOOS=linux
  GOARCH=amd64 CGO_ENABLED=0),曾被误标为 macOS Mach-O 导致 UCloud 启动失败
- connector-linux-arm64 (9.4MB): 新增 ARM 架构

docs/TDC_LITE_拆分打包说明.md: 新增 §9 k8s 原生双镜像部署(OrbStack/UCloud
通用清单)
2026-08-20 17:02:12 +08:00

25 lines
1001 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
set -e
echo "=== [1] 装 k3s(国内源,避免 get.k3s.io 超时)==="
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | \
INSTALL_K3S_MIRROR=cn sh -s - --write-kubeconfig-mode 644
echo "=== [2] 等 k3s Ready ==="
for i in $(seq 1 60); do
if sudo k3s kubectl get node 2>/dev/null | grep -q " Ready"; then
echo "k3s Ready after ${i}s"; break
fi
sleep 2
done
sudo k3s kubectl get node -o wide
echo
echo "=== [3] 节点上不需要 docker,k3s 自带 containerd(Image 需从 UHub 拉)==="
sudo k3s crictl version 2>&1 | head -2 || true
echo
echo "=== [4] 写 kubeconfig 给本地用 ==="
sudo cat /etc/rancher/k3s/k3s.yaml > /tmp/kubeconfig-uhost.yaml 2>/dev/null
# 替换 server 为公网 IP(默认 server 是 https://127.0.0.1:6443,从外网连要改成 EIP)
sed -i "s|server: https://.*:6443|server: https://106.75.176.3:6443|" /tmp/kubeconfig-uhost.yaml
echo "kubeconfig saved → /tmp/kubeconfig-uhost.yaml"
head -10 /tmp/kubeconfig-uhost.yaml