GithubHelp home page GithubHelp logo

pkesavap / csi-driver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ovirt/csi-driver

0.0 0.0 0.0 8.17 MB

oVirt's CSI driver for Openshift and Kubernetes

License: Other

Dockerfile 0.85% Makefile 2.40% Go 84.38% Shell 12.37%

csi-driver's Introduction

oVirt CSI driver

Docker Repository on Quay

Implementation of a CSI driver for oVirt.

This work is a continuation of the work done in github.com/ovirt/ovirt-openshift-extensions, and is the future of the development of a storage driver for oVirt.

This repo also contains an operator to deploy the driver on OpenShift or Kubernetes with most of the code based on openshift/csi-operator.

Prerequisites

Before installation, please ensure that you are running a k8s cluster which supports the CSI implementation, such as Openshift

Installation

Openshift/OKD 4:

  • Clone this repository
  • Ensure that you have oc installed locally
  • Run:
    export KUBECONFIG=</path/to/your>/auth/kubeconfig
    oc create -f deploy/csi-driver
    
  • validate:
    export KUBECONFIG=</path/to/your>/auth/kubeconfig
    oc get pods -n ovirt-csi-driver
    oc new-project zzz-test
    oc create -f deploy/csi-driver/example
    oc get pods -n zzz-test
    

Examples for StorageClass, PVC and Pod:

StorageClass:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ovirt-csi-sc
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: csi.ovirt.org
parameters:
  # the name of the oVirt storage domain. "nfs" is just an example.
  storageDomainName: "nfs"
  thinProvisioning: "true"

PVC:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: 1g-ovirt-cow-disk
  annotations:
    volume.beta.kubernetes.io/storage-class: ovirt-csi-sc
spec:
  storageClassName: ovirt-csi-sc
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

Pod:

apiVersion: v1 
kind: Pod 
metadata:
  name: testpodwithcsi
spec:
  containers:
  - image: busybox
    name: testpodwithcsi
    command: ["sh", "-c", "while true; do ls -la /opt; echo this file system was made availble using ovirt csi driver; sleep 1m; done"]
    imagePullPolicy: Always
    volumeMounts:
    - name: pv0002
      mountPath: "/opt"
  volumes:
  - name: pv0002
    persistentVolumeClaim:
      claimName: 1g-ovirt-cow-disk

Kubernetes:

  • tbc

Development

Deploy

  • operator
  • dev/test

OpenShift vs Kubernetes

  • credential requests (CredentialRequest) require the openshift cloud credentials operator in order to provision. You will need to either deploy the operator and create the ovirt-credentials secret in the kube-system namespace, or provision the ovirt-credentials secret yourself into the ovirt-csi-driver namespace.

Troubleshooting

Get all the objects for the CSI driver

$ oc get all -n ovirt-csi-driver
NAME                       READY   STATUS            RESTARTS   AGE
pod/ovirt-csi-node-2nptq   0/2     PodInitializing   0          2d23h
pod/ovirt-csi-node-7t266   2/2     Running           0          15m
pod/ovirt-csi-plugin-0     0/3     PodInitializing   0          2d23h

NAME                            DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/ovirt-csi-node   1         1         1       1            1           <none>          2d23h

NAME                                READY   AGE
statefulset.apps/ovirt-csi-plugin   0/1     2d23h

ovirt-csi-plugin is a pod, that is part of the StatefulSet, running the controller's logic (create volume, delete volume, attach volume and more). It runs the following containers: csi-external-attacher (triggers ControllerPublish/UnpublishVolume), csi-external-provisioner (mainly for Create/DeleteVolume) and ovirt-csi-driver.

ovirt-csi-node is a DaemonSet running the csi-driver-registrar (provides information about the driver with GetPluginInfo and GetPluginCa pabilities) and ovirt-csi-driver.

The sidecar containers (csi-external-attacher, csi-external-provisioner, csi-driver-registrar) run alongside ovirt-csi-driver and run its code via gRPC.

Get inside the pod's containers:

oc -n ovirt-csi-driver rsh -c <container name> pod/ovirt-csi-node-2nptq

Watch logs:

oc logs pods/ovirt-csi-node-2nptq -n ovirt-csi-driver -c <container name> | less

csi-driver's People

Contributors

bennyz avatar mriedmann avatar openshift-merge-robot avatar peterclauterbach avatar rgolangh avatar sandrobonazzola avatar tux-o-matic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.