Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

openebs-archive/jiva-csi

Repository files navigation

Note: The code from this repository has been migrated to https://github.com/openebs/jiva-operator

jiva-csi

Releases Slack channel #openebs Twitter PRs Welcome Go Report Card Build Status

Overview

Jiva CSI driver implements the csi-spec for the provision and deprovision of the OpenEBS Jiva volumes on kubernetes.

Jiva CSI driver comprises of 2 components:

  • A controller component launched as a StatefulSet, implementing the CSI controller services. The Control Plane services are responsible for creating/deleting the required OpenEBS Volume.
  • A node component that runs as a DaemonSet, implementing the CSI node services. The node component is responsible for performing the iSCSI connection management and connecting to the OpenEBS Volume.

Quick Start

Prerequisites

  1. Kubernetes version 1.14 or higher
  2. OpenEBS Version 1.5 or higher installed. The steps to install OpenEBS are here
  3. jiva-operator must be installed. The steps to install jiva-operator is here
  4. iSCSI initiator utils installed on all the worker nodes
  5. You have access to install RBAC components into kube-system namespace. The Jiva CSI driver components are installed in kube-system namespace to allow them to be flagged as system critical components.

Installation

Run following commands to proceed with the installation:

  • For Ubuntu 16.04.

    kubectl apply -f https://raw.githubusercontent.com/openebs/jiva-csi/master/deploy/jiva-csi-ubuntu-16.04.yaml
    
  • For Ubuntu 18.04

    kubectl apply -f https://raw.githubusercontent.com/openebs/jiva-csi/master/deploy/jiva-csi.yaml
    

Verify that the Jiva CSI Components are installed.

$ kubectl get pods -n kube-system -l role=openebs-csi
NAME                            READY   STATUS    RESTARTS   AGE
openebs-jiva-csi-controller-0   4/4     Running   0          6m14s
openebs-jiva-csi-node-56t5g     2/2     Running   0          6m13s

Provision a Jiva volume

  1. Create Jiva volume policy to set various policies for creating jiva volume. Though this is optional as there are already some default values are set for some field like replicaSC, replicationFactor etc with default value openebs-hostpath and 3 respectively. A sample jiva volume policy CR looks like:
     apiVersion: openebs.io/v1alpha1
     kind: JivaVolumePolicy
     metadata:
       name: example-jivavolumepolicy
       namespace: openebs
     spec:
       replicaSC: openebs-hostpath
       enableBufio: false
       autoScaling: false
       target:
         # monitor: false
         replicationFactor: 1
         # auxResources:
         # tolerations:
         # resources:
         # affinity:
         # nodeSelector:
         # priorityClassName:
       # replica:
         # tolerations:
         # resources:
         # affinity:
         # nodeSelector:
         # priorityClassName:
    
  2. Create a Storage Class to dynamically provision volumes using jiva-csi driver. A sample storage class looks like:
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: openebs-jiva-csi-sc
    provisioner: jiva.csi.openebs.io
    parameters:
      cas-type: "jiva"
      policy: "example-jivavolumepolicy"
    
  3. Create PVC by specifying the above Storage Class in the PVC spec
    kind: PersistentVolumeClaim
    apiVersion: v1
    metadata:
      name: jiva-csi-demo
    spec:
      storageClassName: openebs-jiva-csi-sc
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 4Gi
    
  4. Deploy your application by specifying the PVC name
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: fio
    spec:
      selector:
        matchLabels:
          name: fio
      replicas: 1
      strategy:
        type: Recreate
        rollingUpdate: null
      template:
        metadata:
          labels:
            name: fio
        spec:
          nodeName: gke-utkarsh-csi-default-pool-953ba289-rt9l
          containers:
          - name: perfrunner
            image: openebs/tests-fio
            command: ["/bin/bash"]
            args: ["-c", "while true ;do sleep 50; done"]
            volumeMounts:
          - mountPath: /datadir
            name: fio-vol
          volumes:
          - name: fio-vol
            persistentVolumeClaim:
              claimName: jiva-csi-demo