Skip to content
Navigation Menu

IBM Cloud

  • CatalogCatalog
  • Cost EstimatorCost Estimator
    • HelpHelp
      • Docs
  • Log in
  • Sign up
  • Catalog
  • Cost Estimator
  • Help
    • Docs

  • Navigation settings

Error

Change theme

This feature is in early stage, some parts of the platform might not fully support different themes yet.

Themes
  1. Catalog

IBM Cloud Block Storage plug-in

A Helm chart for installing ibmcloud block storage plugin

  • Date of last update: 01/08/2024
  • Readme file
  • Helm chart
  • IBM
  • 01/08/2024
  • Databases
  • Readme file
Copy
Select your deployment target

Select a delivery method

Select a delivery method

Select product version

    Version last updated: 12/01/2022

    Summary

    IBM Cloud Block Storage plug-in

    Introduction

    IBM Cloud Block Storage is persistent, high-performance iSCSI storage that you can add to your apps by using Kubernetes persistent volumes (PVs). To create and mount block storage to your app, you must install the IBM Cloud Block Storage plug-in by using a Helm chart. This Helm chart also includes the creation of pre-defined block storage classes that you can use to define the size and IOPS of the block storage device that you want to create.

    For more information about IBM Cloud Block Storage, see Getting started with Block Storage.

    Plugin Details

    When you install the IBM Cloud Block Storage plug-in , the following Kubernetes resources are deployed into your Kubernetes cluster:

    • IBM Cloud Block Storage driver daemonset: The daemonset deploys one ibmcloud-block-storage-driver pod on every worker node in your cluster. The daemonset contains the Kubernetes flex driver plug-in to communicate with the kubelet component in your cluster.
    • IBM Cloud Block Storage plug-in pod: The pod contains the storage provisioner controllers to work with the Kubernetes controllers.
    • IBM-provided storage classes: You can use the storage classes to create block storage with a specific configuration.
    • Kubernetes service accounts, RBAC cluster roles and cluster role bindings: The service accounts and RBAC roles authorize the plug-in to interact with your Kubernetes resources.

    Prerequisites

    • Create or use an existing standard Kubernetes cluster that you provisioned with IBM Cloud Kubernetes Service.

    Resources Required

    To install this plugin in your cluster, you must have the Administrator platform role.

    PodSecurityPolicy Requirements

    The IBM Cloud Block Storage driver daemonset must access hostpath volumes to install binaries. To enable access to these volumes, the predefined pod security policy ibm-privileged-psp is used.

    Installing the Chart

    1. Make sure that your worker node applies the latest patch for your minor version.

      1. List the current patch version of your worker nodes.

        ibmcloud ks workers --cluster 
        

        Example output:

        OK
        ID                                                  Public IP        Private IP     Machine Type           State    Status   Zone    Version
        kube-dal10-crb1a23b456789ac1b20b2nc1e12b345ab-w26   169.xx.xxx.xxx    10.xxx.xx.xxx   b3c.4x16.encrypted      normal   Ready    dal10   1.12.6_1523*
        

        If your worker node does not apply the latest patch version, you see an asterisk (*) in the Version column of your CLI output.

      2. Review the version changelog to find the changes that are included in the latest patch version.

      3. Apply the latest patch version by reloading your worker node. Follow the instructions in the ibmcloud ks worker-reload command to gracefully reschedule any running pods on your worker node before you reload your worker node. Note that during the reload, your worker node machine is updated with the latest image and data is deleted if not stored outside the worker node.

    2. Install this chart

    3. Verify that the installation was successful.

      kubectl get pod -n kube-system | grep block
      

      Example output:

      ibmcloud-block-storage-driver-kh4mt                              1/1       Running   0          27d       10.118.98.19   10.118.98.19
      ibmcloud-block-storage-plugin-58c5f9dc86-pbl4t                   1/1       Running   0          14d       172.21.0.204   10.118.98.19
      

      The installation is successful when you see one ibmcloud-block-storage-plugin pod and one or more ibmcloud-block-storage-driver pods. The number of ibmcloud-block-storage-driver pods equals the number of worker nodes in your cluster. All pods must be in a Running state.

    4. Verify that the storage classes for block storage were added to your cluster.

      kubectl get storageclasses | grep block
      

      Example output:

      ibmc-block-bronze            ibm.io/ibmc-block
      ibmc-block-custom            ibm.io/ibmc-block
      ibmc-block-gold              ibm.io/ibmc-block
      ibmc-block-retain-bronze     ibm.io/ibmc-block
      ibmc-block-retain-custom     ibm.io/ibmc-block
      ibmc-block-retain-gold       ibm.io/ibmc-block
      ibmc-block-retain-silver     ibm.io/ibmc-block
      ibmc-block-silver            ibm.io/ibmc-block
      
    5. Repeat these steps for every cluster where you want to provision block storage.

    Mounting IBM Cloud Block Storage to your pod

    You can provision block storage for your cluster by creating a persistent volume claim (PVC). A PVC is a request for storage that you want to add to your cluster. In your PVC, you include all the details about your storage, such as the size and IOPS.

    When you create your PVC, a persistent volume (PV) is automatically created for you. A persistent volume is a Kubernetes resource that points to an actual storage device on a server. By mounting a PVC to your pod, you mount the PV to your pod and create a mount point that you can use to read from and write to that storage device.

    1. Create a PVC in the default namespace of your cluster. This example uses an example PVC that provisions 20 GB of block storage by using the ibmc-block-bronze storage class. For more information about how to create your own PVC, see Adding block storage to apps.

      1. Create a configuration file for your PVC.
        kind: PersistentVolumeClaim
        apiVersion: v1
        metadata:
          name: claim1-block-bronze
          annotations:
            volume.beta.kubernetes.io/storage-class: "ibmc-block-bronze" # name of the storage class
          labels:
            billingType: "monthly" # optional params [hourly | monthly (default)]
        spec:
          accessModes:
            - ReadWriteOnce # access mode
          resources:
            requests:
              storage: 20Gi #
        
      2. Create the PVC in your cluster.
        kubectl apply -f pvc.yaml
        
    2. Verify that the PVC was created and bound to a PV. This process might take a few minutes to complete.

      kubectl get pvc -n default
      

      Example output:

      NAME                  STATUS    VOLUME                                     CAPACITY   ACCESSMODES   STORAGECLASS        AGE
      claim1-block-bronze   Bound     pvc-a10522a0-ad75-11e7-9741-b21aa31307c7   20Gi       RWO           ibmc-block-bronze   1m
      

      Your PVC is created successfully when the Status of your PVC shows Bound.

    3. Mount the PVC to a pod. You can use the yaml in this repository to deploy a pod to your cluster that mounts the PVC that you created earlier.

      1. Create a configuration file for your pod.
        apiVersion: v1
        kind: Pod
        metadata:
          name: pod1-claim1
        spec:
          containers:
          - image: rabbitmq 
            name: container-name
            volumeMounts:
            - mountPath: /myvolumepath
              name: pvc-name
          volumes:
          - name: pvc-name
            persistentVolumeClaim:
              claimName: claim1-block-bronze
        
      2. Create the pod in your cluster.
        kubectl apply -f pod.yaml
        
    4. Verify that the pod was created successfully.

      kubectl get pod
      

      Example output:

      NAME          READY     STATUS    RESTARTS   AGE
      pod1-claim1   1/1       Running   0          1m
      

      The creation of your pod is successful when the Status of your pod shows Running.

    5. Log in to the pod.

      kubectl exec -it pod1-claim1 /bin/bash
      
    6. View the mount path.

      df -h | grep myvolumepath
      

      Example output:

      /dev/mapper/3600a09803830387574244b316b7a7961   20G   44M   19G   1% /myvolumepath
      
    7. Navigate to the mount directory.

      cd /myvolumepath/
      
    8. List all the files in this mount directory.

      ls
      

      Example output:

      lost+found
      
    9. Create a new file and write a short text to the file.

      echo "Test write" >> test.txt
      
    10. Verify that the file was created.

      ls
      

      Example output:

      lost+found  test.txt
      
    11. Verify that the file includes your text.

      cat test.txt
      

      Example output:

      Test write
      
    12. Exit your pod.

    To remove the plug-in:

    1. Delete the resources associated with the workspace instance created with this offering

    Limitations

    • This chart can run only on an amd64 architecture type.

    Getting support


    If you're experiencing issues with this product, go to the IBM Cloud Support Center and navigate to creating a case. Use the All products option to search for this product to continue creating the case or to find more information about getting support. Third party and community supported products might direct you to a support process outside of IBM Cloud.

    Summary

    IBM Cloud Block Storage plug-in

    • Deployment target: IBM Cloud Kubernetes Service
    • Delivery method: Helm chart
    Already have an account? Log in