Skip to content

Commit 6c8630b

Browse files
committed
fix
1 parent a86c24b commit 6c8630b

File tree

2 files changed

+31
-39
lines changed

2 files changed

+31
-39
lines changed

deploy/example/mountstorage/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can also use a different managed-identity for different persistent volumes (
1717

1818
- Create a storage account container, e.g.
1919
```bash
20-
resourcegroup="aks-fuseblob-mi"
20+
resourcegroup="blobfuse-mi"
2121
storageaccountname="myaksblob"
2222
az storage account create -g "$resourcegroup" -n "$storageaccountname" --access-tier Hot --sku Standard_LRS
2323
az storage container create -n mycontainer --account-name "$storageaccountname" --public-access off
@@ -28,14 +28,14 @@ You can also use a different managed-identity for different persistent volumes (
2828
1. Give kubelet identity access to storage account
2929
```bash
3030
aksnprg="$(az aks list -g "$resourcegroup" --query "[?name == '$aksname'].nodeResourceGroup" -o tsv)"
31-
kloid="$(az identity list -g "$aksnprg" --query "[?name == 'aks-fuseblob-mi-agentpool'].principalId" -o tsv)"
31+
kloid="$(az identity list -g "$aksnprg" --query "[?name == 'blobfuse-mi-agentpool'].principalId" -o tsv)"
3232
said="$(az storage account list -g "$resourcegroup" --query "[?name == '$storageaccountname'].id" -o tsv)"
3333
az role assignment create --assignee-object-id "$kloid" --role "Storage Blob Data Owner" --scope "$said"
3434
```
3535

3636
1. Get the clientID of kubelet identity
3737
```bash
38-
az identity list -g "$resourcegroup" --query "[?name == 'aks-fuseblob-mi-agentpool'].clientId" -o tsv
38+
az identity list -g "$resourcegroup" --query "[?name == 'blobfuse-mi-agentpool'].clientId" -o tsv
3939
```
4040

4141
## Option#2: grant a dedicated user-assigned managed identity access to storage account
@@ -89,7 +89,7 @@ You can use a dedicated user-assigned managed identity to mount the storage.
8989
volumeHandle: pv-blob1
9090
volumeAttributes:
9191
protocol: fuse
92-
resourceGroup: aks-fuseblob-mi
92+
resourceGroup: blobfuse-mi
9393
storageAccount: myaksblob
9494
containerName: mycontainer
9595
AzureStorageAuthType: MSI
@@ -252,7 +252,7 @@ You can use a dedicated user-assigned managed identity to mount the storage.
252252
volumeHandle: pv-blob2
253253
volumeAttributes:
254254
protocol: fuse
255-
resourceGroup: aks-fuseblob-mi
255+
resourceGroup: blobfuse-mi
256256
storageAccount: myaksblob
257257
containerName: mycontainer
258258
AzureStorageAuthType: MSI

deploy/example/mountstorage/deployment.yaml

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,38 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
labels:
5-
app: nginx-app1
6-
name: nginx-app1
5+
app: nginx
6+
name: deployment-blob
77
spec:
88
replicas: 1
99
selector:
1010
matchLabels:
11-
app: nginx-app1
11+
app: nginx
1212
template:
1313
metadata:
1414
labels:
15-
app: nginx-app1
15+
app: nginx
16+
name: deployment-blob
1617
spec:
18+
nodeSelector:
19+
"kubernetes.io/os": linux
1720
containers:
18-
- image: mcr.microsoft.com/oss/nginx/nginx:1.19.5
19-
name: webapp
20-
imagePullPolicy: Always
21-
resources: {}
22-
ports:
23-
- containerPort: 80
24-
volumeMounts:
25-
- name: pvc-blob1
26-
mountPath: /usr/share/nginx/html
27-
volumes:
28-
- name: pvc-blob1
29-
persistentVolumeClaim:
30-
claimName: pvc-blob1
31-
status: {}
32-
33-
---
34-
35-
apiVersion: v1
36-
kind: Service
37-
metadata:
38-
name: nginx-app1
39-
labels:
40-
run: nginx-app1
41-
spec:
42-
ports:
43-
- port: 80
44-
protocol: TCP
45-
selector:
46-
app: nginx-app1
47-
type: LoadBalancer
21+
- name: deployment-blob
22+
image: mcr.microsoft.com/oss/nginx/nginx:1.17.3-alpine
23+
command:
24+
- "/bin/sh"
25+
- "-c"
26+
- while true; do echo $(date) >> /mnt/blob/outfile; sleep 1; done
27+
volumeMounts:
28+
- name: blob
29+
mountPath: "/mnt/blob"
30+
readOnly: false
31+
volumes:
32+
- name: blob
33+
persistentVolumeClaim:
34+
claimName: pvc-blob1
35+
strategy:
36+
rollingUpdate:
37+
maxSurge: 0
38+
maxUnavailable: 1
39+
type: RollingUpdate

0 commit comments

Comments
 (0)