WARNING: This driver is in ALPHA currently. Do NOT use this driver in a production environment in its current state.
This driver allows Kubernetes to use azure file volume, csi plugin name: file.csi.azure.com
Status: Aplha
Azure File CSI Driver Version | Image | v0.3.0 | v1.0.0 |
---|---|---|---|
v0.1.0-alpha | mcr.microsoft.com/k8s/csi/azurefile-csi:v0.1.0-alpha | yes | no |
v0.2.0-alpha | mcr.microsoft.com/k8s/csi/azurefile-csi:v0.2.0-alpha | no | yes |
master branch | mcr.microsoft.com/k8s/csi/azurefile-csi:latest | no | yes |
Azure File CSI Driver\Kubernetes Version | 1.12 | 1.13+ |
---|---|---|
v0.1.0-alpha | yes | yes |
v0.2.0-alpha | no | yes |
master branch | no | yes |
Please refer to file.csi.azure.com
driver parameters
storage class
file.csi.azure.com
parameters are compatible with built-in azurefile plugin
- The driver initialization depends on a Cloud provider config file, usually it's
/etc/kubernetes/azure.json
on all k8s nodes deployed by AKS or aks-engine, here is an azure.json example
Please refer to install azurefile csi driver
- Create an azurefile CSI storage class
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/storageclass-azurefile-csi.yaml
- Create an azurefile CSI PVC
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/pvc-azurefile-csi.yaml
- Use
kubectl create secret
to createazure-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 an azurefile CSI PV, download
pv-azurefile-csi.yaml
file and editshareName
involumeAttributes
wget https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/pv-azurefile-csi.yaml
vi pv-azurefile-csi.yaml
kubectl create -f pv-azurefile-csi.yaml
- Create an azurefile CSI PVC which would be bound to the above PV
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/pvc-azurefile-csi-static.yaml
- make sure pvc is created and in
Bound
status finally
watch kubectl describe pvc pvc-azurefile
- create a pod with azurefile CSI PVC
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/nginx-pod-azurefile.yaml
- watch the status of pod until its Status changed from
Pending
toRunning
and then enter the pod container
$ watch kubectl describe po nginx-azurefile
$ kubectl exec -it nginx-azurefile -- bash
root@nginx-azurefile:/# df -h
Filesystem Size Used Avail Use% Mounted on
overlay 30G 19G 11G 65% /
tmpfs 3.5G 0 3.5G 0% /dev
...
//f571xxx.file.core.windows.net/pvc-file-dynamic-e2ade9f3-f88b-11e8-8429-000d3a03e7d7 1.0G 64K 1.0G 1% /mnt/azurefile
...
In the above example, there is a /mnt/azurefile
directory mounted as dysk filesystem.
Please refer to development guide