feat(k01): add agent join mode to install-k3s.sh
This commit is contained in:
+9
-15
@@ -64,27 +64,21 @@ CNPG 每个 Cluster Ready 后自动生成 `<cluster>-app` Secret(username/pass
|
||||
|
||||
## 加节点
|
||||
|
||||
在 server 上取 token:
|
||||
|
||||
```bash
|
||||
cat /var/lib/rancher/k3s/server/node-token
|
||||
```
|
||||
|
||||
新机器上执行:
|
||||
|
||||
```bash
|
||||
cd /root/juwan-backend/deploy/k01
|
||||
bash install-k3s.sh agent
|
||||
echo "<zot-admin-password>" > /root/registry-password && chmod 600 /root/registry-password
|
||||
|
||||
K3S_URL=https://<server-ip>:6443 K3S_TOKEN=<token> bash install-k3s.sh agent
|
||||
```
|
||||
|
||||
`install-k3s.sh agent` 会自动从 server 取 node-token 并加入集群。也可以手动操作:
|
||||
|
||||
```bash
|
||||
cat /var/lib/rancher/k3s/server/node-token
|
||||
|
||||
curl -sfL https://get.k3s.io | \
|
||||
K3S_URL=https://<server-ip>:6443 K3S_TOKEN=<token> \
|
||||
sh -
|
||||
scp root@<server-ip>:/etc/rancher/k3s/registries.yaml /etc/rancher/k3s/
|
||||
systemctl restart k3s-agent
|
||||
```
|
||||
|
||||
pod 调度由 k3s 自动分配。有状态 pod 如需固定在某台节点上,可加 `nodeSelector`。
|
||||
|
||||
## 日常操作
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user