Skip to content

Commit e8275c4

Browse files
authored
Merge pull request #191388 from andyzhangx/patch-39
Update csi-storage-drivers.md
2 parents a177a55 + d07bd13 commit e8275c4

File tree

1 file changed

+19
-26
lines changed

1 file changed

+19
-26
lines changed

articles/aks/csi-storage-drivers.md

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Enable Container Storage Interface (CSI) drivers on Azure Kubernetes Serv
33
description: Learn how to enable the Container Storage Interface (CSI) drivers for Azure disks and Azure Files in an Azure Kubernetes Service (AKS) cluster.
44
services: container-service
55
ms.topic: article
6-
ms.date: 03/10/2022
6+
ms.date: 03/11/2022
77
author: palma21
88

99
---
@@ -17,18 +17,12 @@ The CSI storage driver support on AKS allows you to natively use:
1717
- [*Azure Files*](azure-files-csi.md), which can be used to mount an SMB 3.0/3.1 share backed by an Azure Storage account to pods. With Azure Files, you can share data across multiple nodes and pods. Azure Files can use Azure Standard Storage backed by regular HDDs or Azure Premium Storage backed by high-performance SSDs.
1818

1919
> [!IMPORTANT]
20-
> Starting in Kubernetes version 1.21, Kubernetes will use CSI drivers only and by default. These drivers are the future of storage support in Kubernetes.
20+
> Starting in Kubernetes version 1.21, AKS will use CSI drivers only and by default. CSI migration is also turned on starting from AKS 1.21, existing in-tree persistent volumes continue to function as they always have; however, behind the scenes Kubernetes hands control of all storage management operations (previously targeting in-tree drivers) to CSI drivers.
2121
>
2222
> Please remove manual installed open source Azure Disk and Azure File CSI drivers before upgrading to AKS 1.21.
2323
>
2424
> *In-tree drivers* refers to the current storage drivers that are part of the core Kubernetes code versus the new CSI drivers, which are plug-ins.
2525
26-
## Limitations
27-
28-
- This feature can only be set at cluster creation time.
29-
- The minimum Kubernetes minor version that supports CSI drivers is v1.17.
30-
- The default storage class will be the `managed-csi` storage class.
31-
3226
## Install CSI storage drivers on a new cluster with version < 1.21
3327

3428
Create a new cluster that can use CSI storage drivers for Azure disks and Azure Files by using the following CLI commands. Use the `--aks-custom-headers` flag to set the `EnableAzureDiskFileCSIDriver` feature.
@@ -67,14 +61,9 @@ $ echo $(kubectl get CSINode <NODE NAME> -o jsonpath="{.spec.drivers[1].allocata
6761
- [Set up Azure File CSI driver on AKS cluster](https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/install-driver-on-aks.md)
6862

6963
## Migrating custom in-tree storage classes to CSI
70-
If you have created custom storage classes based on the in-tree storage drivers, these will need to be migrated when you have upgraded your cluster to 1.21.x.
71-
72-
Whilst explicit migration to the CSI provider is not needed for your storage classes to still be valid, to be able to use CSI features (snapshotting etc.) you will need to carry out the migration.
73-
74-
Migration of these storage classes will involve deleting the existing storage classes, and re-provisioning them with the provisioner set to **disk.csi.azure.com** if using Azure Disks, and **files.csi.azure.com** if using Azure Files.
75-
76-
Whilst this will update the mapping of the storage classes, the binding of the Persistent Volume to the CSI provisioner will only take place at provisioning time. This could be during a cordon & drain operation (cluster update) or by detaching and reattaching the Volume.
64+
If you have created in-tree driver storage classes, those storage classes will continue to work since CSI migration is turned on after upgrading your cluster to 1.21.x, while if you want to use CSI features (snapshotting etc.) you will need to carry out the migration.
7765

66+
Migration of these storage classes will involve deleting the existing storage classes, and re-creating them with the provisioner set to **disk.csi.azure.com** if using Azure Disks, and **files.csi.azure.com** if using Azure Files.
7867

7968
### Migrating Storage Class provisioner
8069

@@ -86,12 +75,11 @@ As an example for Azure disks:
8675
kind: StorageClass
8776
apiVersion: storage.k8s.io/v1
8877
metadata:
89-
name: managed-premium-retain
78+
name: custom-managed-premium
9079
provisioner: kubernetes.io/azure-disk
91-
reclaimPolicy: Retain
80+
reclaimPolicy: Delete
9281
parameters:
93-
storageaccounttype: Premium_LRS
94-
kind: Managed
82+
storageAccountType: Premium_LRS
9583
```
9684
9785
#### CSI storage class definition
@@ -100,26 +88,30 @@ parameters:
10088
kind: StorageClass
10189
apiVersion: storage.k8s.io/v1
10290
metadata:
103-
name: managed-premium-retain
91+
name: custom-managed-premium
10492
provisioner: disk.csi.azure.com
105-
reclaimPolicy: Retain
93+
reclaimPolicy: Delete
10694
parameters:
107-
storageaccounttype: Premium_LRS
108-
kind: Managed
95+
storageAccountType: Premium_LRS
10996
```
11097
11198
The CSI storage system supports the same features as the In-tree drivers, so the only change needed would be the provisioner.
11299
113-
114-
### Migrating in-tree disk persistent volumes
100+
## Migrating in-tree persistent volumes
115101
116102
> [!IMPORTANT]
117103
> If your in-tree Persistent Volume reclaimPolicy is set to Delete you will need to change the Persistent Volume to Retain to persist your data. This can be achieved via a [patch operation on the PV](https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/). For example:
118104
> ```console
119105
> $ kubectl patch pv pv-azuredisk --type merge --patch '{"spec": {"persistentVolumeReclaimPolicy": "Retain"}}'
120106
> ```
121107

122-
If you have in-tree persistent volumes, get disk ID from `azureDisk.diskURI` and then follow this [guide][azure-disk-static-mount] to set up CSI driver persistent volumes
108+
### Migrating in-tree Azure Disk persistent volumes
109+
110+
If you have in-tree Azure Disk persistent volumes, get `diskURI` from in-tree persistent volumes and then follow this [guide][azure-disk-static-mount] to set up CSI driver persistent volumes
111+
112+
### Migrating in-tree Azure File persistent volumes
113+
114+
If you have in-tree Azure File persistent volumes, get `secretName`, `shareName` from in-tree persistent volumes and then follow this [guide][azure-file-static-mount] to set up CSI driver persistent volumes
123115

124116
## Next steps
125117

@@ -140,6 +132,7 @@ If you have in-tree persistent volumes, get disk ID from `azureDisk.diskURI` and
140132
<!-- LINKS - internal -->
141133
[azure-disk-volume]: azure-disk-volume.md
142134
[azure-disk-static-mount]: azure-disk-volume.md#mount-disk-as-volume
135+
[azure-file-static-mount]: azure-files-volume.md#mount-file-share-as-a-persistent-volume
143136
[azure-files-pvc]: azure-files-dynamic-pv.md
144137
[premium-storage]: ../virtual-machines/disks-types.md
145138
[az-disk-list]: /cli/azure/disk#az_disk_list

0 commit comments

Comments
 (0)