Install QingCloud CSI

    This tutorial demonstrates how to use KubeKey to set up a KubeSphere cluster and configure QingCloud CSI to provide storage services.

    Your cluster nodes are created on QingCloud Platform.

    Step 1: Create Access Keys on QingCloud Platform

    To make sure the platform can create cloud disks for your cluster, you need to provide the access key ( and qy_secret_access_key) in a separate configuration file of QingCloud CSI.

    1. Log in to the web console of QingCloud and select Access Key from the drop-down list in the top-right corner.

    2. Click Create to generate keys. Download the key after it is created, which is stored in a csv file.

    The separate configuration file contains all parameters of QingCloud CSI which will be used by KubeKey during installation.

    1. Go to one of the nodes (taskbox) where you want to download KubeKey later and run the following command to create a configuration file.

      An example configuration file:

      1. config:
      2. qy_access_key_id: "MBKTPXWCIRIEDQYQKXYL" # Replace it with your own key id.
      3. qy_secret_access_key: "cqEnHYZhdVCVif9qCUge3LNUXG1Cb9VzKY2RnBdX" # Replace it with your own access key.
      4. zone: "pek3a" # Lowercase letters only.
      5. sc:
      6. isDefaultClass: true # Set it as the default storage class.
    2. The field zone specifies where your cloud disks are created. On QingCloud Platform, you must select a zone before you create them.

      storage-zone

      Make sure the value you specify for zone matches the region ID below:

      If you want to configure more values, see .

    3. Save the file.

    Step 3: Download KubeKey

    Download KubeKey from its or use the following command directly.

    1. curl -sfL https://get-kk.kubesphere.io | VERSION=v1.2.0 sh -

    Run the following command first to make sure you download KubeKey from the correct zone.

    1. export KKZONE=cn

    Run the following command to download KubeKey:

    1. curl -sfL https://get-kk.kubesphere.io | VERSION=v1.2.0 sh -

    Note

    After you download KubeKey, if you transfer it to a new machine also with poor network connections to Googleapis, you must run export KKZONE=cn again before you proceed with the steps below.

    Note

    The commands above download the latest release (v1.2.0) of KubeKey. You can change the version number in the command to download a specific version.

    Make kk executable:

    1. Specify a Kubernetes version and a KubeSphere version that you want to install. For example:

      1. ./kk create config --with-kubernetes v1.21.5 --with-kubesphere v3.2.0

      Note

      • Recommended Kubernetes versions for KubeSphere 3.2.0: v1.19.x, v1.20.x, v1.21.x or v1.22.x (experimental). If you do not specify a Kubernetes version, KubeKey will install Kubernetes v1.21.5 by default. For more information about supported Kubernetes versions, see Support Matrix.

      • If you do not add the flag --with-kubesphere in the command in this step, KubeSphere will not be deployed unless you install it using the addons field in the configuration file or add this flag again when you use ./kk create cluster later.

      • If you add the flag --with-kubesphere without specifying a KubeSphere version, the latest version of KubeSphere will be installed.

    2. A default file config-sample.yaml will be created if you do not customize the name. Edit the file.

      1. vi config-sample.yaml
      1. ...
      2. metadata:
      3. name: sample
      4. spec:
      5. - {name: master, address: 192.168.0.2, internalAddress: 192.168.0.2, user: root, password: Testing123}
      6. - {name: node1, address: 192.168.0.3, internalAddress: 192.168.0.3, user: root, password: Testing123}
      7. - {name: node2, address: 192.168.0.4, internalAddress: 192.168.0.4, user: root, password: Testing123}
      8. roleGroups:
      9. - master
      10. master:
      11. - master
      12. worker:
      13. - node1
      14. - node2
      15. controlPlaneEndpoint:
      16. domain: lb.kubesphere.local
      17. address: ""
      18. port: "6443"
      19. kubernetes:
      20. version: v1.21.5
      21. imageRepo: kubesphere
      22. clusterName: cluster.local
      23. network:
      24. plugin: calico
      25. kubePodsCIDR: 10.233.64.0/18
      26. kubeServiceCIDR: 10.233.0.0/18
      27. registry:
      28. registryMirrors: []
      29. insecureRegistries: []
      30. addons:
      31. - name: csi-qingcloud
      32. namespace: kube-system
      33. sources:
      34. chart:
      35. name: csi-qingcloud
      36. repo: https://charts.kubesphere.io/test
      37. ...
    3. Note

      KubeKey will install QingCloud CSI by Helm charts together with its StorageClass.

    4. Save the file and execute the following command to install Kubernetes and KubeSphere:

      1. ./kk create cluster -f config-sample.yaml
    5. When the installation finishes, you can inspect installation logs with the following command:

      Expected output:

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

    Step 5: Verify Installation

    You can verify that QingCloud CSI has been successfully installed either from the command line or from the KubeSphere web console.

    1. Run the following command to check your storage class.

      1. kubectl get sc

      Expected output:

      1. NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
      2. csi-qingcloud (default) disk.csi.qingcloud.com Delete WaitForFirstConsumer true 28m
    2. Run the following command to check the statuses of Pods.

      1. kubectl get pod -n kube-system

      Note that csi-qingcloud is installed in the namespace kube-system. Expected output (exclude other irrelevant Pods):

    KubeSphere console

    1. Log in to the web console with the default account and password (admin/[[email protected]](https://kubesphere.io/cdn-cgi/l/email-protection)) at <NodeIP>:30880. Click Platform in the upper-left corner and select Cluster Management.

    2. Go to Pods in Application Workloads and select kube-system from the project drop-down list. You can see that the Pods of csi-qingcloud are up and running.

    3. Go to Storage Classes under Storage, and you can see available storage classes in your cluster.

      Note