Skip to content

Commit 639115a

Browse files
authored
Merge pull request #88141 from zr-msft/aks-premium-dynamic-files
[AKS] added premium storage skus
2 parents 8f44d71 + 81f2da2 commit 639115a

File tree

2 files changed

+84
-23
lines changed

2 files changed

+84
-23
lines changed

articles/aks/azure-files-dynamic-pv.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: mlearned
66

77
ms.service: container-service
88
ms.topic: article
9-
ms.date: 07/08/2019
9+
ms.date: 09/12/2019
1010
ms.author: mlearned
1111

1212
#Customer intent: As a developer, I want to learn how to dynamically create and attach storage using Azure Files to pods in AKS.
@@ -31,6 +31,7 @@ A storage class is used to define how an Azure file share is created. A storage
3131
* *Standard_LRS* - standard locally redundant storage (LRS)
3232
* *Standard_GRS* - standard geo-redundant storage (GRS)
3333
* *Standard_RAGRS* - standard read-access geo-redundant storage (RA-GRS)
34+
* *Premium_LRS* - premium locally redundant storage (LRS)
3435

3536
> [!NOTE]
3637
> Azure Files support premium storage in AKS clusters that run Kubernetes 1.13 or higher.
@@ -50,6 +51,9 @@ mountOptions:
5051
- file_mode=0777
5152
- uid=1000
5253
- gid=1000
54+
- mfsymlinks
55+
- nobrl
56+
- cache=none
5357
parameters:
5458
skuName: Standard_LRS
5559
```
@@ -99,7 +103,7 @@ kubectl apply -f azure-pvc-roles.yaml
99103

100104
## Create a persistent volume claim
101105

102-
A persistent volume claim (PVC) uses the storage class object to dynamically provision an Azure file share. The following YAML can be used to create a persistent volume claim *5GB* in size with *ReadWriteMany* access. For more information on access modes, see the [Kubernetes persistent volume][access-modes] documentation.
106+
A persistent volume claim (PVC) uses the storage class object to dynamically provision an Azure file share. The following YAML can be used to create a persistent volume claim *5 GB* in size with *ReadWriteMany* access. For more information on access modes, see the [Kubernetes persistent volume][access-modes] documentation.
103107

104108
Now create a file named `azure-file-pvc.yaml` and copy in the following YAML. Make sure that the *storageClassName* matches the storage class created in the last step:
105109

@@ -117,6 +121,9 @@ spec:
117121
storage: 5Gi
118122
```
119123
124+
> [!NOTE]
125+
> If using the *Premium_LRS* sku for your storage class, the minimum value for *storage* must be *100Gi*.
126+
120127
Create the persistent volume claim with the [kubectl apply][kubectl-apply] command:
121128
122129
```console
@@ -194,17 +201,7 @@ Volumes:
194201

195202
## Mount options
196203

197-
Default *fileMode* and *dirMode* values differ between Kubernetes versions as described in the following table.
198-
199-
| version | value |
200-
| ---- | ---- |
201-
| v1.6.x, v1.7.x | 0777 |
202-
| v1.8.0-v1.8.5 | 0700 |
203-
| v1.8.6 or above | 0755 |
204-
| v1.9.0 | 0700 |
205-
| v1.9.1 or above | 0755 |
206-
207-
If using a cluster of version 1.8.5 or greater and dynamically creating the persistent volume with a storage class, mount options can be specified on the storage class object. The following example sets *0777*:
204+
The default value for *fileMode* and *dirMode* is *0755* for Kubernetes version 1.9.1 and above. If using a cluster with Kuberetes version 1.8.5 or greater and dynamically creating the persistent volume with a storage class, mount options can be specified on the storage class object. The following example sets *0777*:
208205

209206
```yaml
210207
kind: StorageClass
@@ -217,6 +214,9 @@ mountOptions:
217214
- file_mode=0777
218215
- uid=1000
219216
- gid=1000
217+
- mfsymlinks
218+
- nobrl
219+
- cache=none
220220
parameters:
221221
skuName: Standard_LRS
222222
```

articles/aks/azure-files-volume.md

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,35 @@ Volumes:
134134

135135
## Mount options
136136

137-
Default *fileMode* and *dirMode* values differ between Kubernetes versions as described in the following table.
137+
The default value for *fileMode* and *dirMode* is *0755* for Kubernetes version 1.9.1 and above. If using a cluster with Kuberetes version 1.8.5 or greater and statically creating the persistent volume object, mount options need to be specified on the *PersistentVolume* object. The following example sets *0777*:
138138

139-
| version | value |
140-
| ---- | ---- |
141-
| v1.6.x, v1.7.x | 0777 |
142-
| v1.8.0-v1.8.5 | 0700 |
143-
| v1.8.6 or above | 0755 |
144-
| v1.9.0 | 0700 |
145-
| v1.9.1 or above | 0755 |
139+
```yaml
140+
apiVersion: v1
141+
kind: PersistentVolume
142+
metadata:
143+
name: azurefile
144+
spec:
145+
capacity:
146+
storage: 5Gi
147+
accessModes:
148+
- ReadWriteMany
149+
storageClassName: azurefile
150+
azureFile:
151+
secretName: azure-secret
152+
shareName: aksshare
153+
readOnly: false
154+
mountOptions:
155+
- dir_mode=0777
156+
- file_mode=0777
157+
- uid=1000
158+
- gid=1000
159+
- mfsymlinks
160+
- nobrl
161+
```
162+
163+
If using a cluster of version 1.8.0 - 1.8.4, a security context can be specified with the *runAsUser* value set to *0*. For more information on Pod security context, see [Configure a Security Context][kubernetes-security-context].
146164

147-
If using a cluster of version 1.8.5 or greater and statically creating the persistent volume object, mount options need to be specified on the *PersistentVolume* object.
165+
To update your mount options, create a *azurefile-mount-options-pv.yaml* file with a *PersistentVolume*. For example:
148166

149167
```yaml
150168
apiVersion: v1
@@ -156,6 +174,7 @@ spec:
156174
storage: 5Gi
157175
accessModes:
158176
- ReadWriteMany
177+
storageClassName: azurefile
159178
azureFile:
160179
secretName: azure-secret
161180
shareName: aksshare
@@ -165,9 +184,51 @@ spec:
165184
- file_mode=0777
166185
- uid=1000
167186
- gid=1000
187+
- mfsymlinks
188+
- nobrl
168189
```
169190

170-
If using a cluster of version 1.8.0 - 1.8.4, a security context can be specified with the *runAsUser* value set to *0*. For more information on Pod security context, see [Configure a Security Context][kubernetes-security-context].
191+
Create a *azurefile-mount-options-pvc.yaml* file with a *PersistentVolumeClaim* that uses the *PersistentVolume*. For example:
192+
193+
```yaml
194+
apiVersion: v1
195+
kind: PersistentVolumeClaim
196+
metadata:
197+
name: azurefile
198+
spec:
199+
accessModes:
200+
- ReadWriteMany
201+
storageClassName: azurefile
202+
resources:
203+
requests:
204+
storage: 5Gi
205+
```
206+
207+
Use the `kubectl` commands to create the *PersistentVolume* and *PersistentVolumeClaim*.
208+
209+
```console
210+
kubectl apply -f azurefile-mount-options-pv.yaml
211+
kubectl apply -f azurefile-mount-options-pvc.yaml
212+
```
213+
214+
Verify your *PersistentVolumeClaim* is created and bound to the *PersistentVolume*.
215+
216+
```console
217+
$ kubectl get pvc azurefile
218+
219+
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
220+
azurefile Bound azurefile 5Gi RWX azurefile 5s
221+
```
222+
223+
Update your container spec to reference your *PersistentVolumeClaim* and update your pod. For example:
224+
225+
```yaml
226+
...
227+
volumes:
228+
- name: azure
229+
persistentVolumeClaim:
230+
claimName: azurefile
231+
```
171232

172233
## Next steps
173234

0 commit comments

Comments
 (0)