feat(deploy): 优化配置

这个提交包含在:
2024-04-09 10:40:43 +08:00 未验证
父节点 6aed27e158
当前提交 15d9d4ff7a
修改 8 个文件,包含 34 行新增24 行删除
+9 -6
查看文件
@@ -1,5 +1,7 @@
### 替换hostname
hostnamectl set-hostname node && reboot
export HOSTNAME=node
hostnamectl set-hostname $HOSTNAME && reboot
vim /etc/hosts
### 安装tailscale
curl -fsSL https://tailscale.com/install.sh | sh
@@ -8,21 +10,22 @@ curl -fsSL https://tailscale.com/install.sh | sh
tailscale set --auto-update
### 开启ip转发
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv4.ip_forward = 1' | tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | tee -a /etc/sysctl.d/99-tailscale.conf
sysctl -p /etc/sysctl.d/99-tailscale.conf
### 新建目录 将不同节点类型的config写入
mkdir -p /etc/rancher/k3s && nano /etc/rancher/k3s/config.yaml
mkdir -p /etc/rancher/k3s && vim /etc/rancher/k3s/config.yaml
### 安装k3s 此处注意安装类型 是server 还是 agent
curl -sfL https://get.k3s.io | \
INSTALL_K3S_VERSION=v1.28.8 \
INSTALL_K3S_MIRROR=cn \
sh -s - server
### 国内安装加速 & 镜像加速地址
https://rancher-mirror.rancher.cn/k3s/k3s-install.sh
nano /etc/rancher/k3s/registries.yaml
vim /etc/rancher/k3s/registries.yaml
### 查看serverToken 记得在config中替换最新的token
cat /var/lib/rancher/k3s/server/node-token