Skip to content

Azure disk Container Storage Interface (CSI) Storage Plugin

License

Notifications You must be signed in to change notification settings

fossabot/azuredisk-csi-driver

 
 

Repository files navigation

azuredisk CSI driver for Kubernetes (Alpha)

FOSSA Status

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

  • supported Kubernetes version: v1.12.0 or later version
  • supported agent OS: Linux

About

This driver allows Kubernetes to use azure disk volume, csi plugin name: disk.csi.azure.com

Driver parameters

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

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

Prerequisite

  • To ensure that all necessary features are enabled, set the following feature gate flags to true:
--feature-gates=CSIPersistentVolume=true,MountPropagation=true,VolumeSnapshotDataSource=true,KubeletPluginsWatcher=true,CSINodeInfo=true,CSIDriverRegistry=true

CSIPersistentVolume is enabled by default in v1.10. MountPropagation is enabled by default in v1.10. VolumeSnapshotDataSource is a new alpha feature in v1.12. KubeletPluginsWatcher is enabled by default in v1.12. CSINodeInfo and CSIDriverRegistry are new alpha features in v1.12.

usually it's /etc/kubernetes/azure.json deployed by AKS or acs-engine, and supports both service principal and msi

Install azuredisk CSI driver on a kubernetes cluster

Please refer to install azuredisk csi driver

Example

1. create a pod with csi azuredisk driver mount on linux

Example#1: Azuredisk Dynamic Provisioning

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

Example#2: Azuredisk Static Provisioning(use an existing azure disk)

  • Create an azuredisk CSI PV, download pv-azuredisk-csi.yaml file and edit diskName, diskURI in volumeAttributes
wget https://raw.githubusercontent.com/andyzhangx/azuredisk-csi-driver/master/deploy/example/pv-azuredisk-csi.yaml
vi pv-azuredisk-csi.yaml
kubectl create -f pv-azuredisk-csi.yaml
  • Create an azuredisk CSI PVC which would be bound to the above PV
kubectl create -f https://raw.githubusercontent.com/andyzhangx/azuredisk-csi-driver/master/deploy/example/pvc-azuredisk-csi-static.yaml

2. validate PVC status and create an nginx pod

  • make sure pvc is created and in Bound status finally
watch kubectl describe pvc pvc-azuredisk
  • create a pod with azuredisk CSI PVC
kubectl create -f https://raw.githubusercontent.com/andyzhangx/azuredisk-csi-driver/master/deploy/example/nginx-pod-azuredisk.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-azuredisk
$ kubectl exec -it nginx-azuredisk -- bash
Filesystem      Size  Used Avail Use% Mounted on
overlay          30G   15G   15G  52% /
...
/devhost/sdc        9.8G   37M  9.8G   1% /mnt/azuredisk
...

In the above example, there is a /mnt/azuredisk directory mounted as disk filesystem.

Kubernetes Development

Please refer to development guide

Links

License

FOSSA Status

About

Azure disk Container Storage Interface (CSI) Storage Plugin

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.1%
  • Makefile 2.1%
  • Other 0.8%