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/aks/csi-secrets-store-driver.md
+13-15Lines changed: 13 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,15 @@ author: nickomang
5
5
ms.author: nickoman
6
6
ms.service: container-service
7
7
ms.topic: how-to
8
-
ms.date: 01/24/2023
8
+
ms.date: 01/25/2023
9
9
ms.custom: template-how-to, devx-track-azurecli
10
10
---
11
11
12
12
# Use the Azure Key Vault Provider for Secrets Store CSI Driver in an AKS cluster
13
13
14
-
The Azure Key Vault Provider for Secrets Store CSI Driver allows for the integration of an Azure key vault as a secret store with an Azure Kubernetes Service (AKS) cluster via a [CSI volume][kube-csi] and has the following features:
14
+
The Azure Key Vault Provider for Secrets Store CSI Driver allows for the integration of an Azure key vault as a secret store with an Azure Kubernetes Service (AKS) cluster via a [CSI volume][kube-csi].
15
+
16
+
## Features
15
17
16
18
* Mounts secrets, keys, and certificates to a pod by using a CSI volume
17
19
* Supports CSI inline volumes
@@ -29,7 +31,7 @@ A container using subPath volume mount won't receive secret updates when it's ro
29
31
30
32
* If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
31
33
* Check that your version of the Azure CLI is 2.30.0 or later. If it's an earlier version, [install the latest version](/cli/azure/install-azure-cli).
32
-
* If you're restricting Ingress to the cluster, check that ports **9808** and **8095** are open.
34
+
* If you're restricting Ingress to the cluster, make sure ports **9808** and **8095** are open.
33
35
34
36
### Supported Kubernetes versions
35
37
@@ -49,7 +51,7 @@ The minimum recommended Kubernetes version is based on the [rolling Kubernetes v
49
51
az aks create -n myAKSCluster -g myResourceGroup --enable-addons azure-keyvault-secrets-provider --enable-managed-identity
50
52
```
51
53
52
-
3. A user-assigned managed identity, named `azurekeyvaultsecretsprovider-*`, is created by the add-on to access Azure resources. The following example uses this identity to connect to the Azure key vault where the secrets will be stored, but you can also use other [identity access methods][identity-access-methods]. Take note of the identity's `clientId` in the output.
54
+
3. A user-assigned managed identity, named `azureKeyvaultSecretsProvider`, is created by the add-on to access Azure resources. The following example uses this identity to connect to the Azure key vault where the secrets will be stored, but you can also use other [identity access methods][identity-access-methods]. Take note of the identity's `clientId` in the output.
53
55
54
56
```json
55
57
...,
@@ -65,18 +67,14 @@ The minimum recommended Kubernetes version is based on the [rolling Kubernetes v
65
67
66
68
## Upgrade an existing AKS cluster with Azure Key Vault Provider for Secrets Store CSI Driver support
67
69
68
-
* Upgrade an existing AKS cluster with Azure Key Vault Provider for Secrets Store CSI Driver capability using the [`az aks enable-addons`][az-aks-enable-addons] command with the `azure-keyvault-secrets-provider` add-on.
70
+
* Upgrade an existing AKS cluster with Azure Key Vault Provider for Secrets Store CSI Driver capability using the [`az aks enable-addons`][az-aks-enable-addons] command with the `azure-keyvault-secrets-provider` add-on. The add-on creates a user-assigned managed identity you can use to authenticate to your Azure key vault.
69
71
70
72
```azurecli-interactive
71
73
az aks enable-addons --addons azure-keyvault-secrets-provider --name myAKSCluster --resource-group myResourceGroup
72
74
```
73
75
74
-
As mentioned in the preceding section, the add-on creates a user-assigned managed identity that you can use to authenticate to your Azure key vault.
75
-
76
76
## Verify the Azure Key Vault Provider for Secrets Store CSI Driver installation
77
77
78
-
The preceding command installs the Secrets Store CSI Driver and the Azure Key Vault Provider on your nodes.
79
-
80
78
* Verify the installation is finished using the `kubectl get pods` command to list all pods that have the `secrets-store-csi-driver` and `secrets-store-provider-azure` labels in the kube-system namespace, and ensure that your output looks similar to the following output:
81
79
82
80
```bash
@@ -91,13 +89,13 @@ The preceding command installs the Secrets Store CSI Driver and the Azure Key Va
Make sure there's a Secrets Store CSI Driver pod and a Secrets Store Provider Azure pod running on each node in your cluster's node pools.
92
+
* Verify that each node in your cluster's node pool has a Secrets Store CSI Driver pod and a Secrets Store Provider Azure pod running.
95
93
96
94
## Create or use an existing Azure key vault
97
95
98
-
In addition to an AKS cluster, you'll need an Azure key vault resource that stores the secret content. Keep in mind that the key vault's name must be globally unique.
96
+
In addition to an AKS cluster, you'll need an Azure key vault resource that stores the secret content.
99
97
100
-
1. Create an Azure key vault using the [`az keyvault create`][az-keyvault-create] command.
98
+
1. Create an Azure key vault using the [`az keyvault create`][az-keyvault-create] command. The name of the key vault must be globally unique.
101
99
102
100
```azurecli
103
101
az keyvault create -n <keyvault-name> -g myResourceGroup -l eastus2
@@ -229,7 +227,7 @@ You might want to create a Kubernetes secret to mirror the mounted content. When
229
227
> [!NOTE]
230
228
> The YAML examples here are incomplete. You'll need to modify them to support your chosen method of access to your key vault identity. For details, see [Provide an identity to access the Azure Key Vault Provider for Secrets Store CSI Driver][identity-access-methods].
231
229
232
-
The secrets will sync only after you start a pod to mount them. Relying only on syncing with the Kubernetes secrets feature doesn't work. When all the pods that consume the secret are deleted, the Kubernetes secret is also deleted.
230
+
The secrets will sync only after you start a pod to mount them. Relying only on syncing with the Kubernetes secrets feature doesn't work. When the pods that consume the secret are deleted, the Kubernetes secret is also deleted.
233
231
234
232
```yml
235
233
apiVersion: secrets-store.csi.x-k8s.io/v1
@@ -299,7 +297,7 @@ Metrics are served via Prometheus from port 8898, but this port isn't exposed ou
0 commit comments