Generation and use of incremental offline packages¶
To meet users' needs for components of certain versions, Kubean provides the script artifacts/airgap_patch.py to generate a corresponding version of offline packages based on the configuration file manifest.yml.
Generate an incremental offline package¶
-
Create a new
manifest.ymlfile in a folder, with the following example:image_arch: - "amd64" - "arm64" kube_version: - "1.24.6" - "1.24.4" calico_version: - "3.23.3" cni_version: - "1.1.1" containerd_version: - "1.6.8" cilium_version: - "1.12.1" -
Create a new
datafolder in the same folder -
Run the following command to generate an incremental offline package in the
datafolderdocker run \ -v $(pwd)/data:/data \ -v $(pwd)/manifest.yml:/manifest.yml \ ghcr.io/kubean-io/airgap-patch:v0.11.1Environment Variables Optional Value Description ( is default value) ZONE DEFAULT: Download offline resources using the default original address.CN: Download offline resources by using DaoCloud mirror address in China.MODE INCR: Build only the offline resources for the components specified in the configuration (i.e.: incremental packages)FULL: Building offline resources includes the components specified in the configuration along with the components necessary for cluster deployment (i.e.: full packages)
Use the incremental offline package¶
The directory structure of the incremental package is as follows:
data
└── airgap_patch
├── amd64
│ ├── files
│ │ ├── import_files.sh
│ │ └── offline-files.tar.gz
│ └── images
│ ├── import_images.sh
│ └── offline-images.tar.gz
├── arm64
│ ├── files
│ │ ├── import_files.sh
│ │ └── offline-files.tar.gz
│ └── images
│ ├── import_images.sh
│ └── offline-images.tar.gz
└── localartifactset.cr.yaml
-
Write file data into MinIO
cd data/airgap_patch/amd64/files MINIO_USER=${username} MINIO_PASS=${password} ./import_files.sh ${minio_address}minio_addressis theminio API Serveraddress, typically on port 9000, for example:http://1.2.3.4:9000. -
Write image data to the docker registry (recommended version 2.6.2) or harbor
cd data/airgap_patch/amd64/images # 1. password-free mode REGISTRY_SCHEME=http REGISTRY_ADDR=${registry_address} ./import_images.sh # 2. Username password mode REGISTRY_SCHEME=https REGISTRY_ADDR=${registry_address} REGISTRY_USER=${username} REGISTRY_PASS=${password} ./import_images.shREGISTRY_ADDRis the address of the mirror repository, e.g.1.2.3.4:5000REGISTRY_USERandREGISTRY_PASSneed to be set when username and password authentication exists for the mirror repository
-
Write
localartifactset.cr.yamlto the k8s clustercd data/airgap_patch kubectl apply -f localartifactset.cr.yamlThis step is to inform the kubean-operator of the new software version available for offline use.