Skip to content

Instantly share code, notes, and snippets.

@clemenko
Last active October 22, 2024 18:39
Show Gist options
  • Save clemenko/e3a823732c23813b43ac18fef0b24498 to your computer and use it in GitHub Desktop.
Save clemenko/e3a823732c23813b43ac18fef0b24498 to your computer and use it in GitHub Desktop.

k3s airgap

Docs

https://docs.k3s.io/installation/airgap#manually-deploy-images-method
https://github.com/k3s-io/k3s/

download

# download these
mkdir /opt/k3s && cd /opt/k3s
curl -#LO https://github.com/k3s-io/k3s/releases/download/v1.25.12%2Bk3s1/k3s
curl -#L  https://get.k3s.io -o install.sh
curl -#LO https://github.com/k3s-io/k3s/releases/download/v1.25.12%2Bk3s1/k3s-airgap-images-amd64.tar
curl -#LO https://github.com/k3s-io/k3s-selinux/releases/download/v1.4.stable.1/k3s-selinux-1.4-1.el9.noarch.rpm
chmod 755 k3s install.sh

tar and move

this step should be self explanatory.

# compress
cd /opt/k3s
tar -vzcf /opt/k3s_airgapped.tgz $(ls)
# decompress
mkdir /opt/k3s
tar -vzxf /opt/k3s_airgapped.tgz -C /opt/k3s

install

run as root

cd /opt/k3s
mkdir -p /var/lib/rancher/k3s/agent/images/ 
mv k3s /usr/local/bin/
mv k3s-airgap-images-amd64.tar /var/lib/rancher/k3s/agent/images/

yum install -y container-selinux k3s-selinux-1.4-1.el9.noarch.rpm

INSTALL_K3S_SKIP_DOWNLOAD=true ./install.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment