Skip to content

Commit 1165dc5

Browse files
committed
doc: update read-from-keyvault example
1 parent f554f91 commit 1165dc5

File tree

5 files changed

+24
-36
lines changed

5 files changed

+24
-36
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@ kubectl create -f storageclass-blobfuse-csi-existing-container.yaml
6262
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pvc-blobfuse-csi.yaml
6363
```
6464

65-
#### Option#2: provide storage account name and key
66-
- Use `kubectl create secret` to create `azure-secret` with existing storage account name and key
65+
#### Option#2: provide storage account name and key(or sastoken)
66+
- Use `kubectl create secret` to create `azure-secret` with existing storage account name and key(or sastoken)
6767
```
68-
kubectl create secret generic azure-secret --from-literal accountname=NAME --from-literal accountkey="KEY" --type=Opaque
68+
kubectl create secret generic azure-secret --from-literal azurestorageaccountname=NAME --from-literal azurestorageaccountkey="KEY" --type=Opaque
69+
#kubectl create secret generic azure-secret --from-literal azurestorageaccountname=NAME --from-literal azurestorageaccountsastoken
70+
="sastoken" --type=Opaque
6971
```
7072

73+
> storage account key(or sastoken) could also be stored in Azure Key Vault, check example here: [read-from-keyvault](./docs/read-from-keyvault.md)
74+
7175
- Create a blobfuse CSI PV, download `pv-blobfuse-csi.yaml` file and edit `containerName` in `volumeAttributes`
7276
```sh
7377
wget https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pv-blobfuse-csi.yaml

deploy/example/keyvault/pvc-blobfuse-csi-static-keyvault.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

deploy/example/keyvault/pv-blobfuse-csi-keyvault.yaml renamed to deploy/example/pv-blobfuse-csi-keyvault.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,5 @@ spec:
1515
volumeAttributes:
1616
containerName: EXISTING_CONTAINER_NAME
1717
storageAccountName: EXISTING_STORAGE_ACCOUNT_NAME
18-
keyVaultURL: xxx
18+
keyVaultURL: https://xxx.vault.azure.net/
1919
keyVaultSecretName: xxx
20-
keyVaultSecretVersion: xxx # use "current versoin" if empty
21-
nodePublishSecretRef:
22-
name: azure-secret
23-
namespace: default

docs/driver-parameters.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ Name | Meaning | Available Value | Mandatory | Default value
2323
--- | --- | --- | --- | ---
2424
volumeAttributes.containerName | existing container name | existing container name | Yes |
2525
volumeAttributes.storageAccountName | existing storage account name | existing storage account name | Yes |
26-
volumeAttributes.keyVaultURL | url of the key vault | the key vault which has been created | Yes |
27-
volumeAttributes.keyVaultSecretName | name of the secret in key vault | the secret which has been created | Yes |
28-
volumeAttributes.keyVaultSecretVersion | existing container name | existing container name | No |if empty, driver will use "current versoin"
29-
nodePublishSecretRef.name | secret name that stores storage account name and key | existing secret name | Yes |
26+
volumeAttributes.keyVaultURL | Azure Key Vault DNS name | existing Azure Key Vault DNS name | No |
27+
volumeAttributes.keyVaultSecretName | Azure Key Vault secret name | existing Azure Key Vault secret name | No |
28+
volumeAttributes.keyVaultSecretVersion | Azure Key Vault secret version | existing version | No |if empty, driver will use "current versoin"
29+
nodePublishSecretRef.name | secret name that stores storage account name and key(or sastoken) | existing kubernetes secret name | No |
3030
nodePublishSecretRef.namespace | namespace where the secret is | k8s namespace | No | `default`
31-

deploy/example/keyvault/README.md renamed to docs/read-from-keyvault.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Use Blobfuse CSI Driver with Azure Key Vault
1+
# Use Blobfuse CSI Driver with storage account key(or sastoken) stored in Azure Key Vault
22

33
> Attention: Currently, we just support use Key Vault in static provisioning scenario.
44
5-
## Prepare Key Vault
5+
## Prerequisite
66

77
1. Create an Azure Key Vault
88

@@ -12,11 +12,14 @@
1212

1313
```console
1414
# Assign Reader Role to the service principal for your keyvault
15-
az role assignment create --role Reader --assignee <YOUR SPN CLIENT ID> --scope /subscriptions/<subscriptionid>/resourcegroups/<resourcegroup>/providers/Microsoft.KeyVault/vaults/$keyvaultname
16-
17-
az keyvault set-policy -n $keyvaultname --key-permissions get --spn <YOUR SPN CLIENT ID>
18-
az keyvault set-policy -n $keyvaultname --secret-permissions get --spn <YOUR SPN CLIENT ID>
19-
az keyvault set-policy -n $keyvaultname --certificate-permissions get --spn <YOUR CLIENT ID>
15+
aadclientid=
16+
keyvaultname=
17+
18+
az role assignment create --role Reader --assignee $aadclientid --scope /subscriptions/<subscriptionid>/resourcegroups/<resourcegroup>/providers/Microsoft.KeyVault/vaults/$keyvaultname
19+
20+
az keyvault set-policy -n $keyvaultname --key-permissions get --spn $aadclientid
21+
az keyvault set-policy -n $keyvaultname --secret-permissions get --spn $aadclientid
22+
az keyvault set-policy -n $keyvaultname --certificate-permissions get --spn $aadclientid
2023
```
2124

2225
## Install blobfuse CSI driver on a kubernetes cluster
@@ -26,15 +29,13 @@ Please refer to [install blobfuse csi driver](https://github.com/csi-driver/blob
2629
1. Download a `pv-blobfuse-csi-keyvault.yaml`, edit `keyVaultURL`, `keyVaultSecretName`, `containerName` in PV
2730
> `keyVaultSecretVersion` is the optional parameter. If not specified, it will be *current versoin*.
2831
```
29-
wget https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/keyvault/pv-blobfuse-csi-keyvault.yaml
32+
wget https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pv-blobfuse-csi-keyvault.yaml
3033
vi pv-blobfuse-csi-keyvault.yaml
3134
kubectl apply -f pv-blobfuse-csi-keyvault.yaml
3235
```
3336

3437
## Create PVC
3538

3639
```console
37-
kubectl apply -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/keyvault/pvc-blobfuse-csi-static-keyvault.yaml
40+
kubectl apply -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pvc-blobfuse-csi-static.yaml
3841
```
39-
40-

0 commit comments

Comments
 (0)