DevOps / Kubernetes Platform Engineering

Building Air-gapped, Offline & Hardened Kubernetes Clusters with Kubespray

A documentation-first project that walks through building an air-gapped, hardened, highly available Kubernetes cluster using Kubespray, with real-world constraints and operational details.

What this project is about

Many Kubernetes examples assume full Internet access and a simple single-node cluster. This project focuses on clusters with little or no Internet connectivity and shows how to run air-gapped and offline Kubernetes clusters with Kubespray.

Air-gapped vs. Offline – what do we mean?

In this project I use two related terms:

Offline / disconnected Kubernetes cluster

A cluster that is installed and operated without relying on direct Internet access. All OS packages and container images are served from internal mirrors and registries.

Air-gapped Kubernetes cluster

A stricter version of the same idea, where the cluster nodes have no routable path to the public Internet at all. All updates, images and packages must be brought in via bastion hosts, USB, or other controlled paths.

The runbook and configs in this repo work for both: you can use them as-is for strict air-gapped environments, or adapt them for “just offline” clusters that occasionally sync from an upstream mirror.

Explore the full runbook & configuration

The GitHub repository contains:

Open the GitHub repository

Deep-dive GitHub issues & extended runbooks

Some of the more advanced parts of this project are documented as GitHub issues. These issues act as extended runbooks you can follow step by step.

These deep-dive issues complement the main runbook by covering day-2 operations such as reconfiguring admission plugins and automating Kubespray re-applies through GitLab pipelines.

Skills demonstrated

Getting started

To dive into the details, start with the main runbook in the GitHub repository and adapt the inventories, group vars and scripts to your own environment (IP addressing, OS version, storage, network policies, etc.).

For a high-level overview, you can also read the accompanying article on Dev.to, which explains the architecture and motivation behind the project.