curl -sfL https://get.rke2.io | sh -
curl -sfL https://rancher-mirror.rancher.cn/rke2/install.sh | INSTALL_RKE2_MIRROR=cn sh -
rke2 - server
systemctl enable rke2 - server.service
systemctl start rke2 - server.service
journalctl -u rke2 - server -f
curl -sfL https://get.rke2.io | INSTALL_RKE2_TYPE="agent" sh -
curl -sfL https://rancher-mirror.rancher.cn/rke2/install.sh | INSTALL_RKE2_MIRROR=cn INSTALL_RKE2_TYPE="agent" sh -
rke2 - agent
systemctl enable rke2 - agent.service
cat /var/lib/rancher/rke2/server/node-token
mkdir -p /etc/rancher/rke2/ && vim /etc/rancher/rke2/config.yaml
config.yaml
server: https://<server-ip>:9345 # 替換為 Server 節點的 IP 或域名 token: K10xxxxxxxxxxxxxxxxxxxxxx # 替換為實際的 token
systemctl start rke2 - agent.service
journalctl -u rke2 - agent -f
powershell -Command "Start - Process PowerShell - Verb RunAs"
Enable - WindowsOptionalFeature - Online - FeatureName containers - All
Containers
Invoke - WebRequest - Uri https://raw.githubusercontent.com/rancher/rke2/master/install.ps1 - Outfile install.ps1
New - Item - Type directory c:/etc/rancher/rke2 - Force
Set - Content - Path c:/etc/rancher/rke2/config.yaml - Value @"server: https://<server>:9345 token: <token from server node>"@
$env:path += ";c:\var\lib\rancher\rke2\bin;c:\usr\local\bin"
(Environment)::SetEnvironmentVariable("path", (Environment)::GetEnvironmentVariable("path", (EnvironmentVariableTarget)::Machine) + ";c:\var\lib\rancher\rke2\bin;c:\usr\local\bin", (EnvironmentVariableTarget)::Machine)
./install.ps1
rke2
rke2.exe agent service --add
Start - Service rke2
# 創建默認目錄(如果不存在) mkdir -p ~/.kube
# 復制配置文件(需要 root 權限) sudo cp /etc/rancher/rke2/rke2.yaml ~/.kube/config
sudo
node - name
NetworkManager
AppArmor
apparmor - parser