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:
To create a fully offline-capable install package, set the --for-offline-installation flag:
Addon Selection
By default, all addons are included in the package. To customize which addons are included, use the --addons-list flag:
# 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:
Example from a local directory using k2s.exe directly:
.\k2s.exe system package --node-package --os debian12 --target-dir "D:\Linuxpackagetest" --name "debian12.zip"
Create an OS-specific node package ZIP:
k2s system package --node-package --os debian12 --target-dir C:\output --name debian12-node.zip
Example for Debian 13:
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:
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:
Either specify one or more addons to export:
Or export all addons:
To export without container images (produces a lighter artifact):
To export without packages (Debian, Linux, and Windows packages):
Both flags can be combined to export only configuration, manifests, and scripts:
Addons Import
To inspect all export options, run:
Either specify one or more addons to import from the offline package:
Or import all addons from the offline package:
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.
-
Creating of and installing from an offline package is currently supported for Host Variant and Development-Only only. ↩