We have an Ubuntu 26.04 host which is not connected to the Internet, so can’t do the online/default RKE2 install and needs the required install files downloaded and transferred to it.
This post will be cleaned up/updated asap..
Commands are:
apt install -y curl ca-certificates apparmor apparmor-utils
swapoff -a
grep -n swap /etc/fstab
vi /etc/fstab
modprobe overlay
modprobe br_netfilter
cat >/etc/modules-load.d/rke2.conf <<‘EOF’
overlay
br_netfilter
EOF
cat >/etc/sysctl.d/90-rke2.conf <<‘EOF’
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
EOF
sysctl –system
RKE2_VERSION=’v1.36.4+rke2r1′
curl -sfL https://get.rke2.io -o install.sh
chmod +x install.sh
echo Would now push install.sh to target host
curl -fLO “https://github.com/rancher/rke2/releases/download/${RKE2_VERSION/+/%2B}/rke2.linux-amd64.tar.gz“
curl -fLO “https://github.com/rancher/rke2/releases/download/${RKE2_VERSION/+/%2B}/sha256sum-amd64.txt“
curl -fLO “https://github.com/rancher/rke2/releases/download/${RKE2_VERSION/+/%2B}/rke2-images.linux-amd64.tar.zst“
mkdir /root/rke2-offline-install
cd /root/rke2-offline
INSTALL_RKE2_ARTIFACT_PATH=/root/rke2-offline sh ./install.sh
which rke2
rke2 –version
ls -l /usr/local/bin/rke2*
mkdir -p /var/lib/rancher/rke2/agent/images
cp /root/rke2-offline/rke2-images.linux-amd64.tar.zst /var/lib/rancher/rke2/agent/images/
touch /var/lib/rancher/rke2/agent/images/.cache.json
ls -la /var/lib/rancher/rke2/agent/images/
mkdir -p /etc/rancher/rke2
cat >/etc/rancher/rke2/config.yaml <<‘EOF’
write-kubeconfig-mode: “0644”
tls-san:
- rke2
- rke2.example.local
- 10.20.30.40
EOF
systemctl enable rke2-server
systemctl start rke2-server
systemctl status rke2-server
export PATH=$PATH:/var/lib/rancher/rke2/bin
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml
cat >/etc/profile.d/rke2.sh <<‘EOF’
export PATH=$PATH:/var/lib/rancher/rke2/bin
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml
EOF
kubectl get nodes -o wide
kubectl get pods -n kube-system
kubectl get helmcharts -n kube-system
kubectl get ingressclass
kubectl get pods -A -o wide