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: articles/azure-arc/kubernetes/tutorial-akv-secrets-provider.md
+26-17Lines changed: 26 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Use Azure Key Vault Secrets Provider extension to fetch secrets into Azure Arc-enabled Kubernetes clusters
3
3
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
4
4
ms.custom: ignite-2022
5
-
ms.date: 10/12/2022
5
+
ms.date: 03/06/2023
6
6
ms.topic: tutorial
7
7
author: mayurigupta13
8
8
ms.author: mayg
@@ -12,7 +12,7 @@ ms.author: mayg
12
12
13
13
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.
14
14
15
-
Benefits of the Azure Key Vault Secrets Provider extension include the following:
15
+
Capabilities of the Azure Key Vault Secrets Provider extension include:
16
16
17
17
- Mounts secrets/keys/certs to pod using a CSI Inline volume
18
18
- Supports pod portability with the SecretProviderClass CRD
@@ -33,7 +33,7 @@ Benefits of the Azure Key Vault Secrets Provider extension include the following
33
33
- Elastic Kubernetes Service
34
34
- Tanzu Kubernetes Grid
35
35
- 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.
37
37
38
38
> [!TIP]
39
39
> 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
56
56
57
57
[](media/tutorial-akv-secrets-provider/extension-install-new-resource.jpg)
58
58
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.
60
60
61
61
### Azure CLI
62
62
@@ -67,13 +67,13 @@ You can install the Azure Key Vault Secrets Provider extension on your connected
67
67
export RESOURCE_GROUP=<resource-group-name>
68
68
```
69
69
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:
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.
77
77
78
78
```json
79
79
{
@@ -204,7 +204,7 @@ To confirm successful installation of the Azure Key Vault Secrets Provider exten
204
204
az k8s-extension show --cluster-type connectedClusters --cluster-name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --name akvsecretsprovider
205
205
```
206
206
207
-
You should see output similar to the example below.
207
+
You should see output similar to this example.
208
208
209
209
```json
210
210
{
@@ -251,14 +251,14 @@ You should see output similar to the example below.
251
251
252
252
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.
253
253
254
-
255
254
Set the following environment variables:
256
255
257
256
```azurecli-interactive
258
257
export AKV_RESOURCE_GROUP=<resource-group-name>
259
258
export AZUREKEYVAULT_NAME=<AKV-name>
260
259
export AZUREKEYVAULT_LOCATION=<AKV-location>
261
260
```
261
+
262
262
Next, run the following command
263
263
264
264
```azurecli
@@ -280,11 +280,11 @@ Before you move on to the next section, take note of the following properties:
280
280
281
281
## Provide identity to access Azure Key Vault
282
282
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.
284
284
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:
The following configuration settings are frequently used with the Azure Key Vault Secrets Provider extension:
378
380
379
381
| Configuration Setting | Default | Description |
380
382
| --------- | ----------- | ----------- |
381
383
| 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. |
383
385
| 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. |
384
386
385
387
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
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:
## Uninstall the Azure Key Vault Secrets Provider extension
398
407
399
408
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
411
420
az k8s-extension list --cluster-type connectedClusters --cluster-name $CLUSTER_NAME --resource-group $RESOURCE_GROUP
412
421
```
413
422
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.
415
424
416
425
## Reconciliation and troubleshooting
417
426
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.
419
428
420
429
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).
0 commit comments