Deploy KubeSphere on Air-Gapped Kubernetes Cluster

    This document explains how to install KubeSphere on an air-gapped Kubernetes cluster.

    You need an image registry set up for the cluster to use. If not yet, please see Configure Harbor for the instructions.

    Step 1: Download Images

    We provide two ways to download KubeSphere images, the image list and the zipped image package.

    Docker uses as the default directory where all Docker related files including the images are stored. Before loading the images into Docker, please check if the disk is big enough. Usually we recommend you to add additional storage to the disk mounted at /var/lib/docker since it requires at least 100G more storage. You can use the fdisk command to expand the disk.

    KubeSphere provides the list of images for you to download one by one to your target machine.

    • These image files are about 30G, please make sure there are enough space in your machine.
    • You can use the script to pull them in batch.

    Image lists (Click here to expand)

    Option 2: Zipped Image Package

    Execute the following command to download the 7.2G image package.

    1. curl -L https://kubesphere.io/download/images/latest > kubesphere-all-images-v2.1.1.tar.gz \
    2. && tar -zxf kubesphere-all-images-v2.1.1.tar.gz && cd kubesphere-images-v2.1.1

    List all images in this folder.

    1. $ tree
    2. .
    3. tree
    4. ├── example_images.tar
    5. ├── istio_images.tar
    6. ├── ks_devops_images.tar
    7. ├── ks_logging_images.tar
    8. ├── ks_minimal_images.tar
    9. ├── ks_notification_images.tar

    Load the image packages into docker. If you only want to set up the default minimal installation, just load the ks_minimal_images. An installation with all optional components and examples requires to load all images as follows.

    1. docker load < ks_minimal_images.tar
    2. docker load < openpitrix_images.tar
    3. docker load < ks_logging_images.tar
    4. docker load < ks_devops_images.tar
    5. docker load < istio_images.tar
    6. docker load < ks_notification_images.tar
    7. docker load < example_images.tar

    Clone the project ks-installer to your local, then enter the scripts folder.

    Since we have to push a batch of images to different projects of Harbor, we can use the following script to create the corresponding projects.

    1. vi create_project_harbor.sh

    Please replace the image registry information with yours in the script.

    1. url="http://192.168.0.31"
    2. passwd="Harbor12345"
    1. ./create_project_harbor.sh

    Execute the following script to push the images that we have loaded above to the Harbor registry in batch.

    Step 3: Installation

    Back to root folder of this repository, and add a new field of Harbor address. Please edit the kubesphere-minimal.yaml or kubesphere-complete-setup.yaml according to your needs.

    1. ···
    2. alerting:
    3. enabled: true
    4. local_registry: 192.168.0.31:80 # Add a new field of Harbor address to this line.
    5. kind: ConfigMap
    6. ···

    Install KubeSphere using kubectl.

    • If there are 1 Core and 2 GB RAM available in your cluster, use the command below to start a default minimal installation only:
    1. kubectl apply -f https://raw.githubusercontent.com/kubesphere/ks-installer/master/kubesphere-minimal.yaml

    You can refer to enable pluggable components to install optional components at your will.

    • If there are 8 Cores and 16 GB RAM available in your cluster, use the command below to install a complete KubeSphere, i.e. with all components enabled:

      Verify the real-time logs use the command as follows.

      When you see the outputs above, congratulation! You can access KubeSphere console in your browser now.

      Step 5: Enable Pluggable Components (Optional)

      If you start with a default minimal installation, execute the following command to open the configmap in order to enable pluggable components. Make sure your cluster has enough CPU and memory, and the corresponding images need to be loaded. Please see Configuration Table for the requirements and for the instructions.

      1. kubectl edit cm -n kubesphere-system ks-installer