Air-Gapped Upgrade with ks-installer

    • You need to have a KubeSphere cluster running v3.1.x. If your KubeSphere version is v3.0.0 or earlier, upgrade to v3.1.x first.
    • Read Release Notes for 3.2.0 carefully.
    • Back up any important component beforehand.
    • A Docker registry. You need to have a Harbor or other Docker registries. For more information, see .
    • Supported Kubernetes versions of KubeSphere 3.2.0: v1.19.x, v1.20.x, v1.21.x, and v1.22.x (experimental).

    Step 1: Prepare Installation Images

    As you install KubeSphere in an air-gapped environment, you need to prepare an image package containing all the necessary images in advance.

    1. Download the image list file from a machine that has access to Internet through the following command:

      Note

      This file lists images under ##+modulename based on different modules. You can add your own images to this file following the same rule. To view the complete file, see .

    2. Download offline-installation-tool.sh.

      1. curl -L -O https://github.com/kubesphere/ks-installer/releases/download/v3.2.0/offline-installation-tool.sh
    3. Make the .sh file executable.

      1. chmod +x offline-installation-tool.sh
    4. You can execute the command ./offline-installation-tool.sh -h to see how to use the script:

      1. [email protected]:/home/ubuntu# ./offline-installation-tool.sh -h
      2. ./offline-installation-tool.sh [-l IMAGES-LIST] [-d IMAGES-DIR] [-r PRIVATE-REGISTRY] [-v KUBERNETES-VERSION ]
      3. Description:
      4. -b : save kubernetes' binaries.
      5. -d IMAGES-DIR : the dir of files (tar.gz) which generated by `docker save`. default: ./kubesphere-images
      6. -l IMAGES-LIST : text file with list of images.
      7. -r PRIVATE-REGISTRY : target private registry:port.
      8. -s : save model will be applied. Pull the images in the IMAGES-LIST and save images as a tar.gz file.
      9. -v KUBERNETES-VERSION : download kubernetes' binaries. default: v1.17.9
    5. Note

      You can choose to pull images as needed. For example, you can delete ##k8s-images and related images under it in images-list.text if you already have a Kubernetes cluster.

    Transfer your packaged image file to your local machine and execute the following command to push it to the registry.

    1. ./offline-installation-tool.sh -l images-list.txt -d ./kubesphere-images -r dockerhub.kubekey.local

    Note

    The domain name is dockerhub.kubekey.local in the command. Make sure you use your own registry address.

    Step 3: Download ks-installer

    Similar to installing KubeSphere on an existing Kubernetes cluster in an online environment, you also need to download kubesphere-installer.yaml.

    1. Execute the following command to download ks-installer and transfer it to your machine that serves as the taskbox for installation.

      1. curl -L -O https://github.com/kubesphere/ks-installer/releases/download/v3.2.0/kubesphere-installer.yaml
      1. kubectl edit cc -n kubesphere-system

      For example, dockerhub.kubekey.local is the registry address in this tutorial, then use it as the value of .spec.local_registry as below:

    2. Save cluster-configuration.yaml after you finish editing it. Replace ks-installer with your own registry address with the following command:

        Warning

        dockerhub.kubekey.local is the registry address in the command. Make sure you use your own registry address.

      Execute the following command after you make sure that all steps above are completed.

      1. kubectl apply -f kubesphere-installer.yaml

      Step 5: Verify Installation

      When the installation finishes, you can see the content as follows:

      1. ### Welcome to KubeSphere! ###
      2. #####################################################
      3. Console: http://192.168.0.2:30880
      4. Account: admin
      5. Password: [email protected]
      6. NOTES
      7. 1. After you log into the console, please check the
      8. monitoring status of service components in
      9. the "Cluster Management". If any service is not
      10. ready, please wait patiently until all components
      11. are up and running.
      12. 2. Please change the default password after login.
      13. #####################################################
      14. #####################################################

      Now, you will be able to access the web console of KubeSphere through with the default account and password admin/[[email protected]](https://kubesphere.io/cdn-cgi/l/email-protection).

      To access the console, make sure port 30880 is opened in your security group.