Skip to content

Commit 07ac268

Browse files
authored
Merge pull request #63870 from hemantksingh/patch-1
Make the pod deployment explicit
2 parents a790d72 + c6be246 commit 07ac268

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

articles/key-vault/general/key-vault-integrate-kubernetes.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ If you're using a service principal, grant permissions for it to access your key
181181
1. Grant the service principal permissions to get secrets:
182182
```azurecli
183183
az keyvault set-policy -n $KEYVAULT_NAME --secret-permissions get --spn $AZURE_CLIENT_ID
184+
az keyvault set-policy -n $KEYVAULT_NAME --key-permissions get --spn $AZURE_CLIENT_ID
184185
```
185186
186187
1. You've now configured your service principal with permissions to read secrets from your key vault. The **$AZURE_CLIENT_SECRET** is the password of your service principal. Add your service principal credentials as a Kubernetes secret that's accessible by the Secrets Store CSI driver:
@@ -233,6 +234,7 @@ If you're using managed identities, assign specific roles to the AKS cluster you
233234
az role assignment create --role "Reader" --assignee $principalId --scope /subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/contosoResourceGroup/providers/Microsoft.KeyVault/vaults/contosoKeyVault5
234235
235236
az keyvault set-policy -n contosoKeyVault5 --secret-permissions get --spn $clientId
237+
az keyvault set-policy -n contosoKeyVault5 --key-permissions get --spn $clientId
236238
```
237239
238240
## Deploy your pod with mounted secrets from your key vault
@@ -305,8 +307,8 @@ spec:
305307
readOnly: true
306308
volumeAttributes:
307309
secretProviderClass: azure-kvname
308-
nodePublishSecretRef:
309-
name: secrets-store-creds
310+
nodePublishSecretRef: # Only required when using service principal mode
311+
name: secrets-store-creds # Only required when using service principal mode
310312
```
311313
312314
Run the following command to deploy your pod:

0 commit comments

Comments
 (0)