Skip to content

Offline Deployment/Upgrade Guide for Worker Clusters

Note

This document is specifically designed for deploying or upgrading the Kubernetes version of worker clusters created on the DCE 5.0 platform in offline mode. It does not cover the deployment or upgrade of other Kubernetes components.

This guide is applicable to the following offline scenarios:

  • You can follow the operational guidelines to deploy the recommended Kubernetes version in a non-GUI environment created by the DCE 5.0 platform.
  • You can upgrade the Kubernetes version of worker clusters created using the DCE 5.0 platform by generating incremental offline packages.

The overall approach is as follows:

  1. Build the offline package on an integrated node.
  2. Import the offline package to the bootstrap node.
  3. Update the Kubernetes version manifest for the global service cluster.
  4. Use the DCE 5.0 UI to create or upgrade the Kubernetes version of the worker cluster.

Note

For a list of currently supported offline Kubernetes versions, refer to the list of Kubernetes versions supported by Kubean.

Building the Offline Package on an Integrated Node

Since the offline environment cannot connect to the internet, you need to prepare an integrated node in advance to build the incremental offline package and start Docker or Podman services on this node. Refer to How to Install Docker?

  1. Check the status of the Docker service on the integrated node.

    ps aux | grep docker
    

    You should see output similar to the following:

    root     12341  0.5  0.2 654372 26736 ?        Ssl  23:45   0:00 /usr/bin/docked
    root     12351  0.2  0.1 625080 13740 ?        Ssl  23:45   0:00 docker-containerd --config /var/run/docker/containerd/containerd.toml
    root     13024  0.0  0.0 112824   980 pts/0    S+   23:45   0:00 grep --color=auto docker
    
  2. Create a file named manifest.yaml in the /root directory of the integrated node with the following command:

    vi manifest.yaml
    

    The content of manifest.yaml should be as follows:

    manifest.yaml
    image_arch:
    - "amd64"
    kube_version: # Specify the version of the cluster to be upgraded
    - "v1.28.0"
    
    • image_arch specifies the CPU architecture type, with options for amd64 and arm64.
    • kube_version indicates the version of the Kubernetes offline package to be built. You can refer to the supported offline Kubernetes versions mentioned earlier.
  3. Create a folder named /data in the /root directory to store the incremental offline package.

    mkdir data
    

    Run the following command to generate the offline package using the kubean airgap-patch image. Make sure the tag of the airgap-patch image matches the Kubean version, and that the Kubean version covers the Kubernetes version you wish to upgrade.

    # Assuming the Kubean version is v0.13.9
    docker run --rm -v $(pwd)/manifest.yaml:/manifest.yaml -v $(pwd)/data:/data ghcr.m.daocloud.io/kubean-io/airgap-patch:v0.13.9
    

    After the Docker service completes running, check the files in the /data folder. The folder structure should look like this:

    data
    ├── amd64
    │   ├── files
    │   │   ├── import_files.sh
    │   │   └── offline-files.tar.gz
    │   ├── images
    │   │   ├── import_images.sh
    │   │   └── offline-images.tar.gz
    │   └── os-pkgs
    │       └── import_ospkgs.sh
    └── localartifactset.cr.yaml
    

Importing the Offline Package to the Bootstrap Node

  1. Copy the /data files from the integrated node to the /root directory of the bootstrap node. On the integrated node , run the following command:

    scp -r data root@x.x.x.x:/root
    

    Replace x.x.x.x with the IP address of the bootstrap node.

  2. On the bootstrap node, copy the image files in the /data folder to the built-in Docker registry of the bootstrap node. After logging into the bootstrap node, run the following commands:

    1. Navigate to the directory where the image files are located.

      cd data/amd64/images
      
    2. Run the import_images.sh script to import the images into the built-in Docker Registry of the bootstrap node.

      REGISTRY_ADDR="127.0.0.1" ./import_images.sh
      

    Note

    The above command is only applicable to the built-in Docker Registry of the bootstrap node. If you are using an external registry, use the following command:

    REGISTRY_SCHEME=https REGISTRY_ADDR=${registry_address} REGISTRY_USER=${username} REGISTRY_PASS=${password} ./import_images.sh
    
    • REGISTRY_ADDR is the address of the image repository, such as 1.2.3.4:5000.
    • If the image repository requires username and password authentication, set REGISTRY_USER and REGISTRY_PASS accordingly.
  3. On the bootstrap node, copy the binary files in the /data folder to the built-in Minio service of the bootstrap node.

    1. Navigate to the directory where the binary files are located.

      cd data/amd64/files/
      
    2. Run the import_files.sh script to import the binary files into the built-in Minio service of the bootstrap node.

      MINIO_USER=rootuser MINIO_PASS=rootpass123 ./import_files.sh http://127.0.0.1:9000
      

Note

The above command is only applicable to the built-in Minio service of the bootstrap node. If you are using an external Minio, replace http://127.0.0.1:9000 with the access address of the external Minio. "rootuser" and "rootpass123" are the default account and password for the built-in Minio service of the bootstrap node.

Updating the Kubernetes Version Manifest for the Global Service Cluster

Run the following command on the bootstrap node to deploy the localartifactset resource to the global service cluster:

kubectl apply -f data/kubeanofflineversion.cr.patch.yaml

Next Steps

Log into the DCE 5.0 UI management interface to continue with the following actions:

  1. Refer to the Creating Cluster Documentation to create a worker cluster, where you can select the incremental version of Kubernetes.

  2. Refer to the Upgrading Cluster Documentation to upgrade your self-built worker cluster.

Comments