I used to setup my homelab kubernetes cluster with Rancher and rke, both are products of Rancher. Honestly I haven’t spent too much time on both. Until recently I want to setup kubernetes cluster, again. So I goto Rancher’s website found that they have another product: RKE2.
It’s easy to setup just follow the RKE2 official installation guide. Here is summary of my installtion manually, I opened a tmux session with 4 panes, one for server, 3 for agents. Each has 4 cores, 8GB RAM 160GB storage, they are VMs running on a host of ESXi instance.
# Add proxy only if you have such dependencycurl -sfL https://get.rke2.io | sudo https_proxy=http://192.168.3.1:8889 INSTALL_RKE2_CHANNEL=latest sh -
sudo bash -c 'cat > /etc/default/rke2-server <<EOF
CONTAINERD_HTTP_PROXY=http://192.168.3.1:8889
CONTAINERD_HTTPS_PROXY=http://192.168.3.1:8889
CONTAINERD_NO_PROXY=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local
EOF'# Orsudo bash -c 'cat > /usr/local/lib/systemd/system/rke2-server.env <<EOF
HOME=/root
HTTP_PROXY=http://192.168.3.1:8889
HTTPS_PROXY=http://192.168.3.1:8889
NO_PROXY=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local
EOF'sudo systemctl enable rke2-server.service
sudo systemctl start rke2-server.service
# sudo journalctl -u rke2-server -fsudo cat /var/lib/rancher/rke2/server/node-token
# save /etc/rancher/rke2/rke2.yaml as token to communicate with cluster api
On Proxmox
Although it’s not good to install on Proxmox instead of VM inside it, for POC purpose I tried to installed it on Proxmox. Below line is required to add to /etc/network/interfaces, under auto vmbr0 section.
Restart network with /etc/init.d/networking restart or with systemd restart networking.
up ip route add default via 192.168.3.1 dev vmbr0
Remote connect via frp
The default connection string is generated for LAN connection(of course), but when connecting from remote from home, you need to expose the API server https port, for example I am using frp.