Skip to content

Commit 1064b9d

Browse files
Merge pull request #229349 from JnHs/jh-arck8-akvopt
link to additional settings details
2 parents b6a79c5 + c8cae1a commit 1064b9d

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

articles/azure-arc/kubernetes/tutorial-akv-secrets-provider.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Use Azure Key Vault Secrets Provider extension to fetch secrets into Azure Arc-enabled Kubernetes clusters
33
description: Learn how to set up the Azure Key Vault Provider for Secrets Store CSI Driver interface as an extension on Azure Arc enabled Kubernetes cluster
44
ms.custom: ignite-2022
5-
ms.date: 10/12/2022
5+
ms.date: 03/06/2023
66
ms.topic: tutorial
77
author: mayurigupta13
88
ms.author: mayg
@@ -12,7 +12,7 @@ ms.author: mayg
1212

1313
The Azure Key Vault Provider for Secrets Store CSI Driver allows for the integration of Azure Key Vault as a secrets store with a Kubernetes cluster via a [CSI volume](https://kubernetes-csi.github.io/docs/). For Azure Arc-enabled Kubernetes clusters, you can install the Azure Key Vault Secrets Provider extension to fetch secrets.
1414

15-
Benefits of the Azure Key Vault Secrets Provider extension include the following:
15+
Capabilities of the Azure Key Vault Secrets Provider extension include:
1616

1717
- Mounts secrets/keys/certs to pod using a CSI Inline volume
1818
- Supports pod portability with the SecretProviderClass CRD
@@ -33,7 +33,7 @@ Benefits of the Azure Key Vault Secrets Provider extension include the following
3333
- Elastic Kubernetes Service
3434
- Tanzu Kubernetes Grid
3535
- Azure Red Hat OpenShift
36-
- Ensure you have met the [general prerequisites for cluster extensions](extensions.md#prerequisites). You must use version 0.4.0 or newer of the `k8s-extension` Azure CLI extension.
36+
- Ensure you've met the [general prerequisites for cluster extensions](extensions.md#prerequisites). You must use version 0.4.0 or newer of the `k8s-extension` Azure CLI extension.
3737

3838
> [!TIP]
3939
> When using this extension with [AKS hybrid clusters provisioned from Azure](extensions.md#aks-hybrid-clusters-provisioned-from-azure-preview) you must set `--cluster-type` to use `provisionedClusters` and also add `--cluster-resource-provider microsoft.hybridcontainerservice` to the command. Installing Azure Arc extensions on AKS hybrid clusters provisioned from Azure is currently in preview.
@@ -56,7 +56,7 @@ You can install the Azure Key Vault Secrets Provider extension on your connected
5656

5757
[![Screenshot of the Azure Key Vault Secrets Provider extension in the Azure portal.](media/tutorial-akv-secrets-provider/extension-install-new-resource.jpg)](media/tutorial-akv-secrets-provider/extension-install-new-resource.jpg)
5858

59-
1. Follow the prompts to deploy the extension. If needed, you can customize the installation by changing the default options on the **Configuration** tab.
59+
1. Follow the prompts to deploy the extension. If needed, customize the installation by changing the default options on the **Configuration** tab.
6060

6161
### Azure CLI
6262

@@ -67,13 +67,13 @@ You can install the Azure Key Vault Secrets Provider extension on your connected
6767
export RESOURCE_GROUP=<resource-group-name>
6868
```
6969

70-
2. Install the Secrets Store CSI Driver and the Azure Key Vault Secrets Provider extension by running the following command:
70+
2. Install the Secrets Store CSI Driver and the Azure Key Vault Secrets Provider extension by running the following command:
7171

7272
```azurecli-interactive
7373
az k8s-extension create --cluster-name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --cluster-type connectedClusters --extension-type Microsoft.AzureKeyVaultSecretsProvider --name akvsecretsprovider
7474
```
7575

76-
You should see output similar to the example below. Note that it may take several minutes before the secrets provider Helm chart is deployed to the cluster.
76+
You should see output similar to this example. Note that it may take several minutes before the secrets provider Helm chart is deployed to the cluster.
7777

7878
```json
7979
{
@@ -204,7 +204,7 @@ To confirm successful installation of the Azure Key Vault Secrets Provider exten
204204
az k8s-extension show --cluster-type connectedClusters --cluster-name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --name akvsecretsprovider
205205
```
206206

207-
You should see output similar to the example below.
207+
You should see output similar to this example.
208208

209209
```json
210210
{
@@ -251,14 +251,14 @@ You should see output similar to the example below.
251251

252252
Next, specify the Azure Key Vault to use with your connected cluster. If you don't already have one, create a new Key Vault by using the following commands. Keep in mind that the name of your Key Vault must be globally unique.
253253

254-
255254
Set the following environment variables:
256255

257256
```azurecli-interactive
258257
export AKV_RESOURCE_GROUP=<resource-group-name>
259258
export AZUREKEYVAULT_NAME=<AKV-name>
260259
export AZUREKEYVAULT_LOCATION=<AKV-location>
261260
```
261+
262262
Next, run the following command
263263

264264
```azurecli
@@ -280,11 +280,11 @@ Before you move on to the next section, take note of the following properties:
280280

281281
## Provide identity to access Azure Key Vault
282282

283-
Currently, the Secrets Store CSI Driver on Arc-enabled clusters can be accessed through a service principal. Follow the steps below to provide an identity that can access your Key Vault.
283+
Currently, the Secrets Store CSI Driver on Arc-enabled clusters can be accessed through a service principal. Follow these steps to provide an identity that can access your Key Vault.
284284

285-
1. Follow the steps [here](../../active-directory/develop/howto-create-service-principal-portal.md#register-an-application-with-azure-ad-and-create-a-service-principal) to create a service principal in Azure. Take note of the Client ID and Client Secret generated in this step.
286-
1. Provide Azure Key Vault GET permission to the created service principal by following the steps [here](../../key-vault/general/assign-access-policy.md).
287-
1. Use the client ID and Client Secret from step 1 to create a Kubernetes secret on the Arc connected cluster:
285+
1. Follow the steps [to create a service principal in Azure](../../active-directory/develop/howto-create-service-principal-portal.md#register-an-application-with-azure-ad-and-create-a-service-principal). Take note of the Client ID and Client Secret generated in this step.
286+
1. Provide Azure Key Vault GET permission to the created service principal by [following these steps](../../key-vault/general/assign-access-policy.md).
287+
1. Use the client ID and Client Secret from the first step to create a Kubernetes secret on the connected cluster:
288288

289289
```bash
290290
kubectl create secret generic secrets-store-creds --from-literal clientid="<client-id>" --from-literal clientsecret="<client-secret>"
@@ -374,12 +374,14 @@ kubectl exec busybox-secrets-store-inline -- cat /mnt/secrets-store/DemoSecret
374374

375375
## Additional configuration options
376376

377-
The following configuration settings are available for the Azure Key Vault Secrets Provider extension:
377+
The Azure Key Vault Secrets Provider extension supports [Helm chart configurations](https://github.com/Azure/secrets-store-csi-driver-provider-azure/blob/master/charts/csi-secrets-store-provider-azure/README.md#configuration).
378+
379+
The following configuration settings are frequently used with the Azure Key Vault Secrets Provider extension:
378380

379381
| Configuration Setting | Default | Description |
380382
| --------- | ----------- | ----------- |
381383
| enableSecretRotation | false | Boolean type. If `true`, periodically updates the pod mount and Kubernetes Secret with the latest content from external secrets store |
382-
| rotationPollInterval | 2m | Specifies the secret rotation poll interval duration if `enableSecretRotation` is `true`. This duration can be adjusted based on how frequently the mounted contents for all pods and Kubernetes secrets need to be resynced to the latest. |
384+
| rotationPollInterval | 2m | If `enableSecretRotation` is `true`, specifies the secret rotation poll interval duration. This duration can be adjusted based on how frequently the mounted contents for all pods and Kubernetes secrets need to be resynced to the latest. |
383385
| syncSecret.enabled | false | Boolean input. In some cases, you may want to create a Kubernetes Secret to mirror the mounted content. If `true`, `SecretProviderClass` allows the `secretObjects` field to define the desired state of the synced Kubernetes Secret objects. |
384386

385387
These settings can be specified when the extension is installed by using the `az k8s-extension create` command:
@@ -388,12 +390,19 @@ These settings can be specified when the extension is installed by using the `az
388390
az k8s-extension create --cluster-name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --cluster-type connectedClusters --extension-type Microsoft.AzureKeyVaultSecretsProvider --name akvsecretsprovider --configuration-settings secrets-store-csi-driver.enableSecretRotation=true secrets-store-csi-driver.rotationPollInterval=3m secrets-store-csi-driver.syncSecret.enabled=true
389391
```
390392

391-
You can also change the settings after installation by using the `az k8s-extension update` command:
393+
You can also change these settings after installation by using the `az k8s-extension update` command:
392394

393395
```azurecli-interactive
394396
az k8s-extension update --cluster-name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --cluster-type connectedClusters --name akvsecretsprovider --configuration-settings secrets-store-csi-driver.enableSecretRotation=true secrets-store-csi-driver.rotationPollInterval=3m secrets-store-csi-driver.syncSecret.enabled=true
395397
```
396398

399+
You can use other configuration settings as needed for your deployment. For example, to change the kubelet root directory while creating a cluster, modify the az k8s-extension create command:
400+
401+
```azurecli-interactive
402+
az k8s-extension create --cluster-name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --cluster-type connectedClusters --extension-type Microsoft.AzureKeyVaultSecretsProvider --name akvsecretsprovider --configuration-settings linux.kubeletRootDir=/path/to/kubelet secrets-store-csi-driver.enable secrets-store-csi-driver.linux.kubeletRootDir=/path/to/kubelet
403+
```
404+
405+
397406
## Uninstall the Azure Key Vault Secrets Provider extension
398407

399408
To uninstall the extension, run the following command:
@@ -411,11 +420,11 @@ To confirm that the extension instance has been deleted, run the following comma
411420
az k8s-extension list --cluster-type connectedClusters --cluster-name $CLUSTER_NAME --resource-group $RESOURCE_GROUP
412421
```
413422

414-
If the extension was successfully removed, you won't see the the Azure Key Vault Secrets Provider extension listed in the output. If you don't have any other extensions installed on your cluster, you'll see an empty array.
423+
If the extension was successfully removed, you won't see the Azure Key Vault Secrets Provider extension listed in the output. If you don't have any other extensions installed on your cluster, you'll see an empty array.
415424

416425
## Reconciliation and troubleshooting
417426

418-
The Azure Key Vault Secrets Provider extension is self-healing. If somebody tries to change or delete an extension component that was deployed when the extension was installed, that component will be reconciled to its original state. The only exceptions are for Custom Resource Definitions (CRDs). If CRDs are deleted, they won't be reconciled. To restore deleted CRDs, use the `az k8s-exstension create` command again with the existing extension instance name.
427+
The Azure Key Vault Secrets Provider extension is self-healing. If somebody tries to change or delete an extension component that was deployed when the extension was installed, that component will be reconciled to its original state. The only exceptions are for Custom Resource Definitions (CRDs). If CRDs are deleted, they won't be reconciled. To restore deleted CRDs, use the `az k8s-extension create` command again with the existing extension instance name.
419428

420429
For more information about resolving common issues, see the open source troubleshooting guides for [Azure Key Vault provider for Secrets Store CSI driver](https://azure.github.io/secrets-store-csi-driver-provider-azure/docs/troubleshooting/) and [Secrets Store CSI Driver](https://secrets-store-csi-driver.sigs.k8s.io/troubleshooting.html).
421430

0 commit comments

Comments
 (0)