Skip to main content

Overview

This document entails steps and procedures to install k8s in an offline environment without internet access, whether in the cloud (public or private), or on bare-metal hardware.

System Parameters/Versions Used for this Example:

  • Rocky Linux: 8.10
  • K8s: 1.29.12
  • Containerd: 1.7.23
  • Docker: 27.2.0

Tools you will need

  • One computer/system with containerd/docker installed and internet access.
    • recommend to use a system with the same chipset as installation system (i.e. AMD64)
  • Destination offline system for installation (no internet access).

Prerequisites

The following packages/dependencies should already be completed:
  • base operating system (OS) updated and patched
  • containerd or docker installed (both on-line and off-line systems)
  • firewalld installed

Prepare K8S Images/Binaries

System with Internet Access

Download all required binaries/images. Perform the following steps from the system with internet access. This example uses a linux machine.

Step 1: Set Version

Set desired K8S version:

Step 2: Download K8S Packages

Download all K8S packages for installation on Rocky 8. Set the repository:
Pull packages, saved in /k8s directory:
Compress directory for easier transfer:

Step 3 (optional): Determine Dependencies

Required dependencies are already listed in the following step, but can verify if necessary. Check which version of K8S was downloaded:
Output should look similar to the following:
In this example, using v1.29.12. Set variable for kubeadm version:
Download kubeadm binary, make executable, and move to bin:
List dependencies:
Output should be similar to the following:

Step 4: Prepare Dependency Images

Pull all required images, can use Docker or containerd. Using Docker:
Save the images as compressed files so that they can be transferred to the offline system:
Using containerd:
Save the images as compressed files so that they can be transferred to the offline system:

Step 5: Transfer Binaries/Images to Offline System

Transfer downloaded binaries and images to offline system. This can be done via secure ssh or removable storage media.
  • k8s.tar.gz
  • kube-apiserver_v1.29.12.tar
  • kube-controller-manager_v1.29.12.tar
  • kube-scheduler_v1.29.12.tar
  • kube-proxy_v1.29.12.tar
  • coredns_v1.11.1.tar
  • pause_3.9.tar
  • etcd_3.5.16-0.tar

Install K8S

Offline System without Internet Access

Import all binaries and images from the system with internet access to the offline system. This example uses a linux machine. Commands have to be performed as root (since it involves installation of Kubernetes).

Step 1: Install K8S Packages

Unzip k8s.tar and install, then enable kubelet:

Step 2: Load K8S Dependency Images

Load K8S images with either docker or containerd(using containerd for this example):

Step 3: Initialize K8S

Initialize and setup cluster control-plane node:
NOTE: Ensure that CNI and Service CIDRs are consistent with previous or desired installation.
Set kubectl config:
Verify that the cluster is running:
Output should be similar to the following:
List running pods:
Output should be similar to the following:
NOTE: coredns pods will be in “Pending” state until flannel (or other CNI) is installed.