Air Gap Installation

Single Node Installation
Install K3s
Note:
  • Make sure you have /usr/local/bin configured in your PATH: export PATH=$PATH:/usr/local/bin). All the commands must be executed as root user.
  • The commands have been tested on Ubuntu Server 20.04 LTS, SUSE Linux Enterprise Server 15 SP4 and RHEL 8.6.
  • For RHEL, K3s needs the following package to be installed: k3s-selinux (repo rancher-k3s-common-stable) and its dependencies container-selinux (repo rhel-8-appstream-rhui-rpms) and policycoreutils-python-utils (repo rhel-8-baseos-rhui-rpms). Also, firewalldnm-cloud-setup.service and nm-cloud-setup.timer must be disabled and the server restarted before the installation, click here for more information.

The steps below you guide you through the air-gap installation of K3s, a lightweight Kubernetes distribution created by Rancher Labs:

Steps

  1. Extract the downloaded file: tar -xf gv-platform-$VERSION.tar
  2. Prepare K3s for air-gap installation:
    # mkdir -p /var/lib/rancher/k3s/agent/images/
    # gunzip -c assets/k3s-airgap-images-amd64.tar.gz > /var/lib/rancher/k3s/agent/images/airgap-images.tar
    # cp assets/k3s /usr/local/bin && chmod +x /usr/local/bin/k3s
    # tar -xzf assets/helm-v3.8.2-linux-amd64.tar.gz
    # cp linux-amd64/helm /usr/local/bin
  3. Install K3s:
    # cat scripts/k3s.sh | INSTALL_K3S_SKIP_DOWNLOAD=true SKIP_PRECHECK=true K3S_KUBECONFIG_MODE="644" sh -s - server --node-name=local-01
  4. Wait for the 30s and check if K3s is running with the command: kubectl get pods -A and systemctl status k3s.service.