diff --git a/content/posts/k3s-cluster-install.md b/content/posts/k3s-cluster-install.md index 923563c..0fef176 100644 --- a/content/posts/k3s-cluster-install.md +++ b/content/posts/k3s-cluster-install.md @@ -23,17 +23,17 @@ categories: ``` 公网 │ - 8.152.2.199 + x.x.x.x ┌──────┴──────┐ │ agent-ali │ ← 唯一暴露公网的节点 │ (HAProxy) │ 运行 HAProxy 代理 k3s API └──────┬──────┘ - │ Tailscale (100.100.1.x) + │ Tailscale (100.100.x.x) ┌──────────────┼──────────────┐ ▼ ▼ ▼ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ server-jz│ │server-jz2│ │server-zen│ - │ 德国 │ │ 德国 │ │ 德国 │ + │ 私有云 │ │ 私有云 │ │ 私有云 │ │ CP+etcd │ │ CP+etcd │ │ CP+etcd │ └──────────┘ └──────────┘ └──────────┘ ``` @@ -46,10 +46,10 @@ categories: | 节点角色 | 节点名 | Tailscale IP | 公网 | 位置 | |---------|--------|-------------|:----:|:----:| -| Server (etcd + control-plane) | server-jz | 100.100.1.12 | ❌ | 德国 | -| Server (etcd + control-plane) | server-jz2 | 100.100.1.13 | ❌ | 德国 | -| Server (etcd + control-plane) | server-zen | 100.100.1.11 | ❌ | 德国 | -| Agent | agent-ali | 100.100.1.10 | ✅ 阿里云 | 中国 | +| Server (etcd + control-plane) | server-jz | 100.100.1.12 | ❌ | 私有云 | +| Server (etcd + control-plane) | server-jz2 | 100.100.1.13 | ❌ | 私有云 | +| Server (etcd + control-plane) | server-zen | 100.100.1.11 | ❌ | 私有云 | +| Agent | agent-ali | 100.100.1.10 | ✅ | 公有云 | ## 前置准备 @@ -128,7 +128,7 @@ sh -s server \ --node-ip=100.100.1.13 \ --advertise-address=100.100.1.13 \ --tls-san=100.100.1.13 \ ---tls-san=8.152.2.199 \ +--tls-san=x.x.x.x \ --vpn-auth="name=tailscale,joinKey=tskey-auth-xxxxx" ``` @@ -140,7 +140,7 @@ sh -s server \ | `--embedded-registry` | 启用内置镜像仓库(zot),本地缓存镜像 | | `--cluster-init` | 初始化集群(仅第一个节点需要) | | `--data-dir /www/k3s` | 指定数据目录 | -| `--tls-san` | 添加证书 SAN,包含公网 IP(8.152.2.199) | +| `--tls-san` | 添加证书 SAN,包含公网 IP(x.x.x.x) | | `--vpn-auth` | 集成 Tailscale 自动加入网络 | 安装完成后获取节点 Token: @@ -202,7 +202,7 @@ sh -s - agent \ sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config # 将 server 地址改为 HAProxy 的公网地址 -kubectl config set-cluster default --server=https://8.152.2.199:6443 +kubectl config set-cluster default --server=https://x.x.x.x:6443 # 验证 export KUBECONFIG=/etc/rancher/k3s/k3s.yaml