Skip to content

Commit bfd8358

Browse files
authored
Update workload-identity-static-pv-mount.md
1 parent d28d57b commit bfd8358

File tree

1 file changed

+42
-3
lines changed

1 file changed

+42
-3
lines changed

docs/workload-identity-static-pv-mount.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# workload identity support on static provisioning
22
- supported from v1.23.3
3+
4+
This feature is specifically designed for blobfuse mount and is not available for NFS mount as NFS mount does not require credentials. There is a standalone blobfuse mount for every pod, it may cause performance issues when multiple pods are present on a single node.
5+
36
## Prerequisites
47
### 1. Create a cluster with oidc-issuer enabled and get the credential
58

@@ -10,12 +13,12 @@ export CLUSTER_NAME=<your cluster name>
1013
export REGION=<your region>
1114
```
1215

13-
### 2. Create a new storage account and container
16+
### 2. Bring your own storage account and storage container
1417
Following the [documentation](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-cli) to create a new storage account and container or use your own. And export following environment variables:
1518
```
1619
export STORAGE_RESOURCE_GROUP=<your storage account resource group>
1720
export ACCOUNT=<your storage account name>
18-
export CONTAINER=<your container name>
21+
export CONTAINER=<your storage container name>
1922
```
2023

2124
### 3. Create managed identity and role assignment
@@ -56,7 +59,7 @@ az identity federated-credential create --name $FEDERATED_IDENTITY_NAME \
5659
--issuer $AKS_OIDC_ISSUER \
5760
--subject system:serviceaccount:${SERVICE_ACCOUNT_NAMESPACE}:${SERVICE_ACCOUNT_NAME}
5861
```
59-
62+
## option#1: static provision with PV
6063
```
6164
cat <<EOF | kubectl apply -f -
6265
apiVersion: v1
@@ -132,3 +135,39 @@ spec:
132135
storage: 10Gi
133136
EOF
134137
```
138+
139+
## option#2: Pod with ephemeral inline volume
140+
```
141+
cat <<EOF | kubectl apply -f -
142+
kind: Pod
143+
apiVersion: v1
144+
metadata:
145+
name: nginx-blobfuse-inline-volume
146+
spec:
147+
serviceAccountName: $SERVICE_ACCOUNT_NAME #required, Pod does not use this service account has no permission to mount the volume
148+
nodeSelector:
149+
"kubernetes.io/os": linux
150+
containers:
151+
- image: mcr.microsoft.com/oss/nginx/nginx:1.19.5
152+
name: nginx-blobfuse
153+
command:
154+
- "/bin/bash"
155+
- "-c"
156+
- set -euo pipefail; while true; do echo $(date) >> /mnt/blobfuse/outfile; sleep 1; done
157+
volumeMounts:
158+
- name: persistent-storage
159+
mountPath: "/mnt/blobfuse"
160+
readOnly: false
161+
volumes:
162+
- name: persistent-storage
163+
csi:
164+
driver: blob.csi.azure.com
165+
volumeAttributes:
166+
storageaccount: $ACCOUNT # required
167+
containerName: $CONTAINER # required
168+
clientID: $USER_ASSIGNED_CLIENT_ID # required
169+
resourcegroup: $STORAGE_RESOURCE_GROUP # optional, specified when the storage account is not under AKS node resource group(which is prefixed with "MC_")
170+
# tenantID: $IDENTITY_TENANT # optional, only specified when workload identity and AKS cluster are in different tenant
171+
# subscriptionid: $SUBSCRIPTION # optional, only specified when workload identity and AKS cluster are in different subscription
172+
EOF
173+
```

0 commit comments

Comments
 (0)