Configure Cloud Storage Devices

This section provides instructions on how to configure cloud storage devices for KubeSphere in a production environment.

To configure cloud storage devices, create an API key in the cloud environment and set up KubeSphere using the API key to integrate with the cloud environment through the Container Storage Interface (CSI). When users create volumes in KubeSphere and mount them to pods, KubeSphere will automatically create storage devices in the cloud environment for pods to use. The following steps outline the specific operations using QingCloud as an example. For instructions related to other cloud environments, please refer to the user guide of the respective cloud environment or contact your cloud service provider.

Prerequisites

Get a QingCloud account and ensure that your account balance is sufficient to create the required storage devices. For more information, visit QingCloud Official Website.

Steps

  1. Log in to the QingCloud console and click your username in the upper-right corner of the page. Select API Keys from the dropdown list.

  2. On the API Keys page, click Create.

  3. In the Create API Key dialog, set the name for the key, and click Submit.

  4. Download the key file to your local machine from the popup dialog.

    Warning

    KubeSphere will use this private key to connect with the storage devices in the cloud. Please keep this private key file securely to prevent any leakage of user data.

  5. Obtain the ID of the API key from the API key list.

  6. Log in to the cluster node used for KubeSphere installation and execute the following command to create the storage plugin configuration file:

    1. vi csi-qingcloud.yaml
  7. Add the following information to the configuration file and save it for future use during KubeSphere installation:

    1. config:
    2. qy_access_key_id: "<key ID>"
    3. qy_secret_access_key: "<access key>"
    4. zone: "<zone ID>"
    5. sc:
    6. isDefaultClass: true

    Replace the following parameters with actual values:

    ParameterDescription

    <key ID>

    The ID of the API key.

    <access key>

    The key text of the API key.

    <zone ID>

    The availability zone ID of the cloud environment. The zone ID determines the region where the storage devices created by KubeSphere will be located. The ID-value mapping for the availability zones is as follows:

    • sh1a/sh1b: Shanghai Zone 1-A/Shanghai Zone 1-B

    • pek3a/pek3b/pek3c/pek3d: Beijing Zone 3-A/Beijing Zone 3-B/Beijing Zone 3-C/Beijing Zone 3-D

    • gd2a/gd2b: Guangdong Zone 2-A/Guangdong Zone 2-B

    • ap2a: Asia Pacific Zone 2-A

    The above configuration file includes only the necessary parameters to be set. For other parameters, please refer to QingCloud CSI Configuration.