Skip to content

ashishranjan738/blobfuse-csi-driver

 
 

blobfuse CSI driver for Kubernetes

TravisCI Coverage Status FOSSA Status

WARNING: This driver is in ALPHA currently. Do NOT use this driver in a production environment in its current state.

About

This driver allows Kubernetes to use azure-storage-fuse, csi plugin name: blobfuse.csi.azure.com

Project Status

Status: Aplha

Container Images & CSI Compatibility:

Blobfuse CSI Driver Version Image v1.0.0
v0.1.0-alpha mcr.microsoft.com/k8s/csi/blobfuse-csi:v0.1.0-alpha yes
master branch mcr.microsoft.com/k8s/csi/blobfuse-csi:latest yes

Kubernetes Compatibility

Blobfuse CSI Driver\Kubernetes Version 1.13+
v0.1.0-alpha yes
master branch yes

Driver parameters

Please refer to blobfuse.csi.azure.com driver parameters

storage class blobfuse.csi.azure.com parameters are compatible with built-in blobfuse plugin

Prerequisite

Install blobfuse CSI driver on a kubernetes cluster

Please refer to install blobfuse csi driver

E2E Usage example

create a pod with blobfuse mount on linux

Dynamic Provisioning (create storage account and container automatically by blobfuse driver)

  • Create a blobfuse CSI storage class
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/storageclass-blobfuse-csi.yaml
  • Create a blobfuse CSI PVC
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pvc-blobfuse-csi.yaml

Static Provisioning(use an existing storage account)

Option#1: use existing credentials in k8s cluster

make sure the existing credentials in k8s cluster(e.g. service principal, msi) could access the specified storage account

  • Download a blobfuse CSI storage class, edit resourceGroup, storageAccount, containerName in storage class
wget https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/storageclass-blobfuse-csi-existing-container.yaml
vi storageclass-blobfuse-csi-existing-container.yaml
kubectl create -f storageclass-blobfuse-csi-existing-container.yaml
  • Create a blobfuse CSI PVC
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pvc-blobfuse-csi.yaml

Option#2: provide storage account name and key

  • Use kubectl create secret to create azure-secret with existing storage account name and key
kubectl create secret generic azure-secret --from-literal accountname=NAME --from-literal accountkey="KEY" --type=Opaque
  • Create a blobfuse CSI PV, download pv-blobfuse-csi.yaml file and edit containerName in volumeAttributes
wget https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pv-blobfuse-csi.yaml
vi pv-blobfuse-csi.yaml
kubectl create -f pv-blobfuse-csi.yaml
  • Create a blobfuse CSI PVC which would be bound to the above PV
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pvc-blobfuse-csi-static.yaml

2. Validate PVC status and create an nginx pod

make sure pvc is created and in Bound status

watch kubectl describe pvc pvc-blobfuse
  • create a pod with blobfuse CSI PVC
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/nginx-pod-blobfuse.yaml

3. enter the pod container to do validation

  • watch the status of pod until its Status changed from Pending to Running and then enter the pod container
$ watch kubectl describe po nginx-blobfuse
$ kubectl exec -it nginx-blobfuse -- bash
Filesystem      Size  Used Avail Use% Mounted on
...
blobfuse         30G  8.9G   21G  31% /mnt/blobfuse
/dev/sda1        30G  8.9G   21G  31% /etc/hosts
...

In the above example, there is a /mnt/blobfuse directory mounted as dysk filesystem.

Kubernetes Development

Please refer to development guide

Links

About

Azure Blobfuse Container Storage Interface (CSI) Storage Plugin

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 75.7%
  • Shell 13.1%
  • Python 7.4%
  • Makefile 2.4%
  • Dockerfile 1.1%
  • Smarty 0.3%