1. Networking
Reference article:
Server cluster (2) WireGuard networking
https://blog.tsinbei.com/archives/621/
2. Install K3S cluster
2.1, Master node
implement
1 | curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn sh -s - --node-external-ip 1.x.x.x --advertise-address 1.x.x.x -- node-ip 192.168.100.1 --flannel-iface wg0 |
--node-external-ip 1.x.x.x
specifies the public IP--advertise-address 1.x.x.x
specifies the communication address, which can be a public IP or a domain name resolved to this IP-node-ip 192.168.100.1
specifies the virtual IP of the intranet of the node--flannel-iface wg0
specifies the virtual NIC
After the installation is complete, execute
1 | systemctl status k3s |
Check the operating status, execute
1 | kubectl get pods -A |
View container status.
2.2, Agent node
execute first
1 | cat /var/lib/rancher/k3s/server/node-token |
Take note of K3S_TOKEN,
K3S_URL defaults to the IP of the Master node: 6443.
implement
1 | curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_URL=https://192.168.100.1:6443 K3S_TOKEN=xxxxx sh -s - --node-external- ip 121.x.x.x --node-ip 192.168.100.2 --flannel-iface wg0 |
2.3, debugging
Execute on the Master node
1 | kubectl get nodes -o wide |
Check the Agent node status.
3. Reference
Multi-cloud to build K3S cluster
https://www.cnsre.cn/posts/211119132529/
Server cluster (3) Cloud servers build K3S cluster
Comments