Skip to content

Instantly share code, notes, and snippets.

@clemenko
Last active March 6, 2026 07:33
Show Gist options
  • Select an option

  • Save clemenko/e3a823732c23813b43ac18fef0b24498 to your computer and use it in GitHub Desktop.

Select an option

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.32.1%2Bk3s1/k3s
curl -#L  https://get.k3s.io -o install.sh
curl -#LO https://github.com/k3s-io/k3s/releases/download/v1.32.1%2Bk3s1/k3s-airgap-images-amd64.tar

#Note - not needed for Debain based systems.
curl -#LO https://github.com/k3s-io/k3s-selinux/releases/download/v1.6.stable.1/k3s-selinux-1.6-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/

#Note - not needed for Debain based systems.
yum install -y container-selinux k3s-selinux-1.4-1.el9.noarch.rpm

INSTALL_K3S_SKIP_DOWNLOAD=true ./install.sh
@clemenko
Copy link
Copy Markdown
Author

Updated for latest K3s and notes about debian based systems.

@davehouser1
Copy link
Copy Markdown

Thanks for updating your notes for Debian based systems. I went through the process and it works. I recommend updating to include the following commands after you untar and move the files around.

chmod +x /usr/local/bin/k3s
chmod +x /opt/k3s/install.sh

Other than that it works great, thank you.

@clemenko
Copy link
Copy Markdown
Author

Awesome.

@davehouser1
Copy link
Copy Markdown

One last note. If your trying to add a worker node (agent) to a master node at install. Use this command to install the agent + connect to the master node: (replace $MASTER_NODE_IP_OR_FQDN, and $TOKEN_TO_USE accordingly. You can gather the master node token from cat /var/lib/rancher/k3s/server/node-token)

INSTALL_K3S_SKIP_DOWNLOAD=true K3S_URL=https://$MASTER_NODE_IP_OR_FQDN:6443 K3S_TOKEN=$TOKEN_TO_USE ./install.sh

Credit to this post that helped figure this out

@clemenko
Copy link
Copy Markdown
Author

clemenko commented Feb 1, 2025

Good call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment