Skip to content

Creating Offline Package

K2s Offline Package

K2s provides support for creating an offline installation package1.

No K2s cluster must be installed in order to create an offline package.

To inspect various parameter options, run:

Bash Session
<repo>\k2s.exe system package -h

To create a fully offline-capable install package, set the --for-offline-installation flag:

Bash Session
<repo>\k2s.exe system package -d <path-to-output-packe>.zip --for-offline-installation

Addon Selection

By default, all addons are included in the package. To customize which addons are included, use the --addons-list flag:

Bash Session
# Include only specific addons
k2s system package -d C:\output -n k2s.zip --addons-list "ingress nginx,monitoring,logging"

# Exclude all addons from the package
k2s system package -d C:\output -n k2s.zip --addons-list none

Note

For multi-implementation addons like ingress, specify the implementation name separated by a space (e.g., ingress nginx or ingress traefik).

The --addons-list flag works with both Dev (default) and Lite profiles.

When running the aforementioned command and no K2s variant has been installed on the current system yet, the Development-Only Variant will be installed in order to create an offline package (which requires an internet connection). If all dependencies are already available locally due to prior installation of K2s, the offline package creation does not require internet connection.

Offline Package Creation Diagram
graph TD
    CallScript["'c\k\smallsetup\helpers\Buildk2sZipPackage.ps1\n [-Proxy myProxy]\n -TargetDirectory myExistingDirectory\n -ZipPackageFileName myZipPackage.zip\n [-ForOfflineInstallation]'"] --> if_for_offline{for offline\n installation?}
    if_for_offline -->|no| AddBaseImageToExclusionList("Include c\k\bin\Kubemaster-Base.vhdx to exclusion list")
    if_for_offline -->|yes| if_baseImage_available{"c\k\bin\Kubemaster-Base.vhdx\n exists?"}
    if_baseImage_available -->|yes| GetFilesAndDirectories
    if_baseImage_available -->|no| BuildAndProvisionKubemasterBaseImage
    AddBaseImageToExclusionList --> GetFilesAndDirectories
    BuildAndProvisionKubemasterBaseImage("Build and provision base image") --> GetFilesAndDirectories
    GetFilesAndDirectories("Get a list with all files and directories") --> FilterByExclusionList
    FilterByExclusionList("Remove files and directories from list according to exclusion list") --> CreateZipPackage
    CreateZipPackage("Create zip package") --> PopulateZipPackage("Populate zip package with directories and files")

Note

Omitting the --for-offline-installation flag will effectively bundle only repository source files similar to the K2s Releases.

Node Package for Offline Node Add

To add a Linux worker node to an existing cluster without internet access on that node, create a node package.

No installed K2s cluster is required to create this node package. You can run the command directly from the extracted K2s repository or release directory.

Inspect the available options:

Bash Session
k2s system package -h

Example from a local directory using k2s.exe directly:

Bash Session
.\k2s.exe system package --node-package --os debian12 --target-dir "D:\Linuxpackagetest" --name "debian12.zip"

Create an OS-specific node package ZIP:

Bash Session
k2s system package --node-package --os debian12 --target-dir C:\output --name debian12-node.zip

Example for Debian 13:

Bash Session
k2s system package --node-package --os debian13 --target-dir C:\output --name debian13-node.zip

Then add the node by passing the package to k2s node add:

Bash Session
k2s node add --ip-addr <IPAddressOfNewNode> --username <UserNameForRemoteConnection> --node-package C:\output\debian13-node.zip

Note

The node package is intended for extending an existing cluster with a Linux worker node. It is separate from the full offline installation package used for installing K2s itself.

Note

Creating the node package does not require that K2s is already installed on the current machine.

See Extending K2s cluster for the complete node onboarding workflow.

Addons Offline Package

To enable addons without an internet connection being available, the required binaries can be exported to an offline package as well.

Addons Export

To inspect all export options, run:

Bash Session
k2s addons export -h

Either specify one or more addons to export:

Bash Session
k2s addons export registry -d <export-output-directory>

Or export all addons:

Bash Session
k2s addons export -d <export-output-directory>

To export without container images (produces a lighter artifact):

Bash Session
k2s addons export registry -d <export-output-directory> --omit-images

To export without packages (Debian, Linux, and Windows packages):

Bash Session
k2s addons export registry -d <export-output-directory> --omit-packages

Both flags can be combined to export only configuration, manifests, and scripts:

Bash Session
k2s addons export registry -d <export-output-directory> --omit-images --omit-packages

Addons Import

To inspect all export options, run:

Bash Session
k2s addons import -h

Either specify one or more addons to import from the offline package:

Bash Session
k2s addons import registry -f <directory-containing-addons-archive>\addons.zip

Or import all addons from the offline package:

Bash Session
k2s addons import -f <directory-containing-addons-archive>\addons.zip

Note

Importing a specific addon from the offline package does obviously not work when this package does not contain the specified addon.

After importing an addon, it can be enabled without internet connection being available.

Delta Packages

For bandwidth-efficient upgrades, K2s supports creating delta packages that contain only the files changed between two versions. This significantly reduces package size for minor and patch upgrades.

See Delta Packages for detailed documentation on creating and applying delta packages.


  1. Creating of and installing from an offline package is currently supported for Host Variant and Development-Only only.