Skip to content

Commit 53c93ef

Browse files
authored
Merge pull request #194166 from andyzhangx/patch-45
Update azure-disk-csi.md
2 parents 18e6454 + a045409 commit 53c93ef

File tree

1 file changed

+1
-94
lines changed

1 file changed

+1
-94
lines changed

articles/aks/azure-disk-csi.md

Lines changed: 1 addition & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Use Container Storage Interface (CSI) drivers for Azure Disks on Azure Ku
33
description: Learn how to use the Container Storage Interface (CSI) drivers for Azure disks in an Azure Kubernetes Service (AKS) cluster.
44
services: container-service
55
ms.topic: article
6-
ms.date: 03/09/2022
6+
ms.date: 04/06/2022
77
author: palma21
88

99
---
@@ -260,99 +260,6 @@ Filesystem Size Used Avail Use% Mounted on
260260
/dev/sdc 15G 46M 15G 1% /mnt/azuredisk
261261
```
262262

263-
## Shared disk
264-
265-
[Azure shared disks](../virtual-machines/disks-shared.md) is an Azure managed disks feature that enables attaching an Azure disk to agent nodes simultaneously. Attaching a managed disk to multiple agent nodes allows you, for example, to deploy new or migrate existing clustered applications to Azure.
266-
267-
> [!IMPORTANT]
268-
> Currently, only raw block device (`volumeMode: Block`) is supported by the Azure disk CSI driver. Applications should manage the coordination and control of writes, reads, locks, caches, mounts, and fencing on the shared disk, which is exposed as a raw block device.
269-
270-
Let's create a file called `shared-disk.yaml` by copying the following command that contains the shared disk storage class and PVC:
271-
272-
```yaml
273-
apiVersion: storage.k8s.io/v1
274-
kind: StorageClass
275-
metadata:
276-
name: managed-csi-shared
277-
provisioner: disk.csi.azure.com
278-
parameters:
279-
skuname: Premium_LRS
280-
maxShares: "2"
281-
cachingMode: None # ReadOnly cache is not available for premium SSD with maxShares>1
282-
reclaimPolicy: Delete
283-
---
284-
kind: PersistentVolumeClaim
285-
apiVersion: v1
286-
metadata:
287-
name: pvc-azuredisk-shared
288-
spec:
289-
accessModes:
290-
- ReadWriteMany
291-
resources:
292-
requests:
293-
storage: 256Gi # minimum size of shared disk is 256GB (P15)
294-
volumeMode: Block
295-
storageClassName: managed-csi-shared
296-
```
297-
298-
Create the storage class with the [kubectl apply][kubectl-apply] command, and specify your `shared-disk.yaml` file:
299-
300-
```console
301-
$ kubectl apply -f shared-disk.yaml
302-
303-
storageclass.storage.k8s.io/managed-csi-shared created
304-
persistentvolumeclaim/pvc-azuredisk-shared created
305-
```
306-
307-
Now let's create a file called `deployment-shared.yml` by copying the following command:
308-
309-
```yaml
310-
apiVersion: apps/v1
311-
kind: Deployment
312-
metadata:
313-
labels:
314-
app: nginx
315-
name: deployment-azuredisk
316-
spec:
317-
replicas: 2
318-
selector:
319-
matchLabels:
320-
app: nginx
321-
template:
322-
metadata:
323-
labels:
324-
app: nginx
325-
name: deployment-azuredisk
326-
spec:
327-
containers:
328-
- name: deployment-azuredisk
329-
image: mcr.microsoft.com/oss/nginx/nginx:1.15.5-alpine
330-
volumeDevices:
331-
- name: azuredisk
332-
devicePath: /dev/sdx
333-
volumes:
334-
- name: azuredisk
335-
persistentVolumeClaim:
336-
claimName: pvc-azuredisk-shared
337-
```
338-
339-
Create the deployment with the [kubectl apply][kubectl-apply] command, and specify your `deployment-shared.yml` file:
340-
341-
```console
342-
$ kubectl apply -f deployment-shared.yml
343-
344-
deployment/deployment-azuredisk created
345-
```
346-
347-
Finally, let's check the block device inside the pod:
348-
349-
```console
350-
# kubectl exec -it deployment-sharedisk-7454978bc6-xh7jp sh
351-
/ # dd if=/dev/zero of=/dev/sdx bs=1024k count=100
352-
100+0 records in
353-
100+0 records out/s
354-
```
355-
356263
## Windows containers
357264

358265
The Azure disk CSI driver also supports Windows nodes and containers. If you want to use Windows containers, follow the [Windows containers tutorial](windows-container-cli.md) to add a Windows node pool.

0 commit comments

Comments
 (0)