Air-Gapped VKS on VCF 9: Make the Inside Boring

VKS on VCF 9 needs a registry the Supervisor can reach before anything runs on it. In an air-gapped environment, that registry is built from whatever somebody carried across, and most of what goes wrong happens before Harbor ever starts: a download that didn’t finish, a checksum nobody ran, a command copied from the wrong page, a value typed into the wrong YAML file. Those mistakes don’t fail where they happen. They show up halfway through the install, or the first time the Supervisor can’t pull, and fixing them usually means another trip across the gap.

That’s why I turned the runbook into a tool: harbor-airgap-kit. It rests on one idea. Check everything on the side that has the internet, carry one transfer that proves itself, and make the inside boring. Version 1.4.1 (14 October 2026) is where the inside finally got there: one tool, no make, no sed, no editor.

Check outside, carry once, check again

Everything that crosses the gap is fetched and checked on a connected workstation, WSL or Linux, and written to one folder with a single SHA256SUMS, written last. That folder is the transfer.

python3 kit catalog --refresh     # anything newer from Broadcom? it asks before each change
python3 kit choose  --env <env>   # what this environment gets from the Broadcom catalog
python3 kit check                 # is kit.yml right, and does every source answer?
python3 kit fetch                 # download, check, and write the transfer folder

kit check makes sure every source answers before anything large downloads. kit fetch checks Harbor’s offline installer against its Sigstore signature and the compose provider against its published checksums or EPEL’s metadata, and imgpkg copies each Broadcom bundle. A failed check leaves nothing behind. Inside, kit publish checks the whole folder against SHA256SUMS again before it stages anything. I want a bad download to fail on the connected side, where fixing it takes a minute.

The Broadcom content is a catalog. broadcom/catalog.yml lists the Supervisor Services, VKS itself, the VKS add-ons and AKO, with the exact image for every version, all from projects.packages.broadcom.com and none of it behind a login. Each environment turns items on by version. The one thing the kit can’t fetch for you is the YAML that registers a Supervisor Service, which only comes from support.broadcom.com. Put it in broadcom/services/ and kit load writes a copy pointed at your Harbor. On VCF 9.1 there are two YAMLs per service, and the “legacy” one is the one for an external registry like this.

The catalog refresh decides nothing on its own. A newer patch becomes the default unless you say no, and a newer line only on a yes. Saying no records a hold with the reason, who and when, so the next person knows why an environment is still on the older version. A version leaves the catalog only when Broadcom’s registry answers 404, never on a timeout, and only if nothing uses it.

Inside, one tool and no editor

In 1.2, the inside still meant copying the vault example, typing passwords into it, encrypting it, and running make targets for the build and the checks. It worked, but every hand edit inside an air gap is a chance to get something wrong where nobody can look anything up. In 1.4, the inside is five commands from one tool:

python3 kit publish --from <transfer> --env <env>   # check the transfer and stage it
python3 kit setup   --env <env>                     # questions: settings, certificate, vault
python3 kit build   --env <env>                     # checks everything first, then builds Harbor
python3 kit load    --env <env>                     # the Broadcom content this environment turns on
python3 kit verify  --env <env>                     # read-only health check, any time

There’s no default environment. Every command needs --env, so nothing runs against the wrong one by accident.

setup is the heart of 1.4. It asks one thing at a time: whether Harbor goes on this machine or on a server (and which account logs in), the registry’s DNS name, the data volume, the certificate, Nexus, the Broadcom items, the passwords. It checks each answer before it accepts it. For the certificate, that means the Subject Alternative Name covers the registry’s name, it’s in date, the key belongs to it, and the CA you gave it actually issued it. Then it lists every change as file: setting old -> new, keeps each file’s comments, and saves only on a yes. Run it again and Enter keeps what’s there.

build, verify and remove run the same checks before they start a playbook, and doctor runs them on their own: ansible-core 2.14 or later, the registry’s label and its host_vars file, leftover placeholders, how Ansible reaches the server, the SSH login, the vault, the staged Harbor files and the certificate. Each failure comes with its fix in one sentence. A healthy environment looks like this:

==> Checking inventories/lab before the build
    OK    ansible-core 2.21                      /opt/harbor-airgap-kit/.venv/bin/ansible-playbook
    OK    Harbor goes on this machine            sudo works
    OK    the vault                              encrypted
    OK    Harbor 2.15.2 staged                   /var/staging/artifacts/harbor
    OK    certificate for harbor.lab.internal    /etc/harbor-lab/pki
Ready. Next: python3 kit build --env lab

I’d rather a command refuse to start and tell me why than get halfway through a playbook and leave a server half built.

The three questions are still the design

The first version of this post started with three questions: where the Harbor files come from, where the certificate comes from, and where the container engine comes from. They’re still the whole design, as three settings in one inventory, and setup asks them for you.

Question Setting Default
Where do the Harbor files come from? nexus_enabled Off: the build reads them from the staging folder on the control host. On: kit publish uploads them to the environment’s Nexus.
Where does the certificate come from? harbor_tls_mode staged: a certificate, key and CA from any CA the Supervisor trusts. ipa has IdM issue it.
Where does the container engine come from? harbor_container_runtime Podman, from the server’s own repos. Docker CE works too.

Do you need Nexus? Usually not. Harbor holds what the Supervisor and VKS pull. Nexus, when it’s on, only holds the files that build Harbor itself, because Harbor can’t hold its own installer before it exists. It earns its place when the site already runs one for other teams, or wants one governed store for everything that crosses the gap. Otherwise it’s one more service to run, patch, back up and secure.

Rules I don’t bend

  • Nothing is downloaded inside. Everything comes in a transfer and is checked against SHA256SUMS.
  • Nothing changes without a yes. Setup, the catalog refresh and removal all ask, with the safe answer as the default. Unattended runs need an explicit --yes.
  • The kit never upgrades a server. OS packages come from the environment’s own repos, and only what a server is missing comes from the transfer.
  • Secrets stay per environment. Passwords live in each environment’s vault, encrypted with ansible-vault. They never travel in a transfer and never appear on a command line.
  • Plain building blocks. ansible-core with ansible.builtin only, and python3’s standard library only. No collections, no Galaxy. I’ve run the build on ansible-core 2.14, which is what RHEL 9 ships, and on 2.21.
  • Every role has a present and an absent side. Running anything twice changes nothing.
  • Releases don’t change once they’re out. A fix gets a new number, which is why there’s a 1.4.1.

Why there’s a 1.4.1

The certificate check in 1.4.0 was too trusting in one case. Handed a CA’s certificate instead of the server’s, it could list the CA’s name constraints as the names the certificate was for. 1.4.1 reads the registry’s name only from the Subject Alternative Name, and says plainly when it’s been handed a CA certificate, or one with no DNS name in it. The SAN is the only place modern clients look anyway: containerd on the VKS nodes ignores the Common Name.

Things that bit me

Most of the time went into small things that each looked like a broken install.

  • WSL stops an idle distribution about 15 seconds after the last command finishes, even with Harbor running under systemd. The browser just says “refused to connect”. The lab keeps a hidden sleep infinity running. instanceIdleTimeout=-1 in .wslconfig works too, but for every distribution.
  • Ansible ignores an ansible.cfg in a world-writable directory without failing, and files copied from C:\ into WSL arrive world-writable. The kit now always runs the playbooks with the repository’s own ansible.cfg.
  • Use imgpkg copy, not push and pull. Only copy follows every image a bundle points at.
  • Harbor’s /health answers 200 while components are still starting. Wait for the status to say healthy, not for the HTTP code.
  • On Podman, install aardvark-dns with netavark, or Harbor’s containers can’t find each other by name.
  • Broadcom’s registry hands downloads to another host. Behind a proxy, allow the storage host as well as projects.packages.broadcom.com.
  • YAML keeps the last of two duplicate keys without a word. A version listed twice in the catalog now stops every command.
  • Enter keeps the current answer, which is the point of setup, until the current answer is the wrong one. If setup recorded yes to IdM on a machine that isn’t enrolled, type n; Enter keeps the yes.
  • Mail filters block .ps1 files, even inside a zip. The kit carries the lab’s PowerShell scripts, so share it through git or a drive link.

What it is not

It’s a standalone Harbor on RHEL, not the Harbor Supervisor Service. Broadcom says not to host VKS’s own images on a Harbor that runs on VKS, and the Supervisor needs a registry before anything runs on it.

On VCF 9.1.1 and later, Broadcom also documents a different air-gapped path: the VCF Download Tool fetches the artifacts, they go into the Software Depot, and Harbor runs as a Supervisor Service. This kit is for the other case, an external registry the Supervisor and VKS pull from. Pick one per environment, and don’t mix the two procedures.

After the build, in vCenter

The kit stops at the registry. The rest is yours.

  1. Add the registry under Supervisor > Configure > Container Registries, with its name and the CA that issued its certificate.
  2. Make the VKS nodes trust that same CA, then pull one image from a node to prove it. Adding a trusted CA rolls a cluster’s nodes, so schedule it with the next VKS update.
  3. Register each Supervisor Service from the YAML kit load wrote, under Workload Management > Services. Upgrade VKS the same way, pointed at the copy in the vks project.
  4. On VKS 3.7 and later, the standard packages are the VKS add-ons. Apply an AddonRepository whose imageURL is your copy, so clusters stop reaching for projects.packages.broadcom.com.
  5. Install AKO from oci://<registry>/ako/helm-charts/ako, with the chart’s image repositories pointed at <registry>/ako.
  6. Change Harbor’s admin password in the portal, then run python3 kit setup and answer no to keeping the vault’s passwords, so the vault gets the new one.

Kubernetes releases still go in through a local content library in vCenter. The transfer can carry the OVAs: list them under files in kit.yml, with a sha256 when you have one.

Try it on a laptop first

The lab runs the whole pipeline on one Windows 11 machine with the same commands an environment uses, plus its own Nexus and its own CA. It’s where every change gets tried before it goes near a real environment. From the kit’s folder in PowerShell, no administrator needed:

PowerShell -ExecutionPolicy Bypass -File .\lab\windows\New-HarborLab.ps1 -RunPipeline

That creates a separate WSL distribution, harbor-lab (AlmaLinux 9), copies the kit to /opt/harbor-airgap-kit, and runs check, fetch, publish, build, load and verify. -Runtime docker puts Harbor on Docker CE instead of Podman, and -Recreate starts clean. On an AlmaLinux, Rocky or RHEL 9 VM, as root from the kit’s folder:

bash lab/bootstrap.sh && make lab-run

To open Harbor from a Windows browser, add 127.0.0.1 harbor.lab.internal to the hosts file and trust the lab’s CA for your account. That CA can only sign the lab’s own names, so trusting it doesn’t trust anything else.

Getting it

git clone https://github.com/noahfarshad/harbor-airgap-kit.git
cd harbor-airgap-kit
python3 kit check

kit check is the first safe run. It reads kit.yml and checks that every source answers, without downloading anything large. inventories/dev is a filled example with example.coach names, so you can see what a finished environment looks like, and python3 kit setup --env <yours> starts your own from inventories/_template. The runbook is docs/HARBOR_REGISTRY.md, and CHANGELOG.md has every change.

What you need: for each environment, a RHEL 9 server (or Rocky or Alma 9) with Podman, 4 vCPU and 8 GB of memory, 160 GB or more at /data, ideally on its own disk, and a DNS name with a certificate for it. Inside, ansible-core 2.14 or later and python3 3.6 or later on the control host. Outside, a workstation with WSL or Linux, python3, bash and curl.

What’s next

Running 1.4.1 end to end on a rebuilt lab turned up three things for 1.4.2:

  • Setup will refuse IdM on a machine that isn’t enrolled, instead of leaving it for the checks before the build to catch.
  • A required data disk will be checked before the playbook starts, not inside it.
  • kit load will check the Harbor login before it pushes anything, instead of failing on the first push with a hint that points at the wrong command.

References

Repository: github.com/noahfarshad/harbor-airgap-kit (release 1.4.1)

Related: When Regional Harbor Sticks, VKS Stops, the registry VKS fails closed on after this kit has arrived.

Scroll to Top