You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/workload-identity.md
+30-33Lines changed: 30 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# How to Use workload identity with Azurefile
1
+
# How to Use workload identity with Blob CSI driver
2
2
3
3
## Prerequisites
4
4
@@ -9,20 +9,16 @@ After you finish the Installation guide, you should have already:
9
9
* installed the mutating admission webhook
10
10
* obtained your cluster’s OIDC issuer URL
11
11
12
-
## 1. Enable Azure Workload Identity Mutating Webhook injection to Pod in the `kube-system` namespace
13
-
14
-
Per [azure-workload-identity Known Issues](https://github.com/Azure/azure-workload-identity/blob/main/docs/book/src/known-issues.md#environment-variables-not-injected-into-pods-deployed-in-the-kube-system-namespace-in-an-aks-cluster), if you're deploying Azurefile in the `kube-system` namespace of an AKS cluster, add the `"admissions.enforcer/disabled": "true"` label or annotation in the [MutatingWebhookConfiguration](https://github.com/Azure/azure-workload-identity/blob/8644a217f09902fa1ac63e05cf04d9a3f3f1ebc3/deploy/azure-wi-webhook.yaml#L206-L235).
15
-
16
-
## 2. Export environment variables
12
+
## 1. Export environment variables
17
13
18
14
```shell
19
15
export CLUSTER_NAME="<your cluster name>"
20
16
export CLUSTER_RESOURCE_GROUP="<cluster resource group name>"
If you are using AKS, you can get the resource group where Azurefile storage class reside by running:
39
+
If you are using AKS, you can get the resource group where Blob storage class reside by running:
44
40
45
41
```shell
46
-
exportAZURE_FILE_RESOURCE_GROUP="$(az aks show --name $CLUSTER_NAME --resource-group $CLUSTER_RESOURCE_GROUP --query "nodeResourceGroup" -o tsv)"
42
+
exportAZURE_BLOB_RESOURCE_GROUP="$(az aks show --name $CLUSTER_NAME --resource-group $CLUSTER_RESOURCE_GROUP --query "nodeResourceGroup" -o tsv)"
47
43
```
48
44
49
-
You can also create resource group by yourself, but you must [specify the resource group](https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/driver-parameters.md#:~:text=current%20k8s%20cluster-,resourceGroup,No,-if%20empty%2C%20driver) in the storage class while using Azurefile.
45
+
You can also create resource group by yourself, but you must [specify the resource group](https://github.com/cvvz/blob-csi-driver/blob/workload_identity/docs/driver-parameters.md) in the storage class while using Blob CSI driver:
50
46
51
47
```shell
52
-
az group create -n $AZURE_FILE_RESOURCE_GROUP -l $LOCATION
48
+
az group create -n $AZURE_BLOB_RESOURCE_GROUP -l $LOCATION
53
49
```
54
50
55
-
## 4. Create an AAD application or user-assigned managed identity and grant required permissions
51
+
## 3. Create an AAD application or user-assigned managed identity and grant required permissions
56
52
57
53
```shell
58
54
# create an AAD application if using Azure AD Application for this tutorial
@@ -61,28 +57,29 @@ az ad sp create-for-rbac --name "${APPLICATION_NAME}"
61
57
62
58
```shell
63
59
# create a user-assigned managed identity if using user-assigned managed identity for this tutorial
60
+
az group create -n ${IDENTITY_RESOURCE_GROUP} -l $LOCATION
64
61
az identity create --name "${USER_ASSIGNED_IDENTITY_NAME}" --resource-group "${IDENTITY_RESOURCE_GROUP}"
65
62
```
66
63
67
-
Grant required permission to the AAD application or user-assigned managed identity, for simplicity, we just assign Contributor role to the resource group where Azurefile storage class reside:
64
+
Grant required permission to the AAD application or user-assigned managed identity, for simplicity, we just assign Contributor role to the resource group where Blob storage class reside:
68
65
69
66
If using Azure AD Application:
70
67
71
68
```shell
72
69
export APPLICATION_CLIENT_ID="$(az ad sp list --display-name "${APPLICATION_NAME}" --query '[0].appId' -otsv)"
73
-
exportAZURE_FILE_RESOURCE_GROUP_ID="$(az group show -n $AZURE_FILE_RESOURCE_GROUP --query 'id' -otsv)"
74
-
az role assignment create --assignee $APPLICATION_CLIENT_ID --role Contributor --scope $AZURE_FILE_RESOURCE_GROUP_ID
70
+
exportAZURE_BLOB_RESOURCE_GROUP_ID="$(az group show -n $AZURE_BLOB_RESOURCE_GROUP --query 'id' -otsv)"
71
+
az role assignment create --assignee $APPLICATION_CLIENT_ID --role Contributor --scope $AZURE_BLOB_RESOURCE_GROUP_ID
0 commit comments