Understand Persistent Storage Installation

Persistent volumes are a must for installing KubeSphere. When you use KubeKey to set up a KubeSphere cluster, you can install different storage systems as add-ons. The general steps of installing KubeSphere by KubeKey on Linux are:

  1. Install Kubernetes.
  2. Install any provided add-ons.
  3. Install KubeSphere by ks-installer.

In the second step, an available StorageClass must be installed. It includes:

  • The StorageClass itself
  • The storage plugin for the StorageClass if necessary

Note

Some storage systems require you to prepare a storage server in advance to provide external storage services.

How Does KubeKey Install Different Storage Systems

KubeKey creates a configuration file (config-sample.yaml by default) for your cluster which contains all the necessary parameters you can define for different resources, including various add-ons. Different storage systems, such as NFS and GlusterFS, can also be installed as add-ons by Helm charts or YAML. To let KubeKey install them in the desired way, you must provide KubeKey with necessary configurations of these storage systems.

There are generally two ways for you to let KubeKey apply configurations of the storage system to be installed.

  1. Input necessary parameters under the addons field directly in config-sample.yaml.
  2. Create a separate configuration file for your add-on to list all the necessary parameters and provide the path of the file in config-sample.yaml so that KubeKey can reference it during installation.

For more information, see add-ons.

Default Storage Class

KubeKey supports the installation of different storage plugins and storage classes. No matter what storage systems you will be installing, you can specify whether it is a default storage class in its configuration file. If KubeKey detects that no default storage class is specified, it will install OpenEBS by default.

OpenEBS Dynamic Local PV provisioner can create Kubernetes Local Persistent Volumes using a unique HostPath (directory) on the node to persist data. It is very convenient for users to get started with OpenEBS when they have no specific storage system.

Multi-storage Solutions

If you intend to install more than one storage plugins, only one of them can be set as the default storage class. Otherwise, KubeKey will be confused about which storage class to use.