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/workload-identity-deploy-cluster.md
+32-4Lines changed: 32 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Deploy and configure an Azure Kubernetes Service (AKS) cluster with workl
3
3
description: In this Azure Kubernetes Service (AKS) article, you deploy an Azure Kubernetes Service cluster and configure it with an Azure AD workload identity (preview).
4
4
ms.topic: article
5
5
ms.custom: devx-track-azurecli
6
-
ms.date: 03/14/2023
6
+
ms.date: 04/12/2023
7
7
---
8
8
9
9
# Deploy and configure workload identity (preview) on an Azure Kubernetes Service (AKS) cluster
@@ -19,7 +19,7 @@ This article assumes you have a basic understanding of Kubernetes concepts. For
19
19
20
20
- This article requires version 2.40.0 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
21
21
22
-
- The identity you're using to create your cluster has the appropriate minimum permissions. For more details on access and identity for AKS, see [Access and identity options for Azure Kubernetes Service (AKS)][aks-identity-concepts].
22
+
- The identity you're using to create your cluster has the appropriate minimum permissions. For more information about access and identity for AKS, see [Access and identity options for Azure Kubernetes Service (AKS)][aks-identity-concepts].
23
23
24
24
- If you have multiple Azure subscriptions, select the appropriate subscription ID in which the resources should be billed using the [az account][az-account] command.
25
25
@@ -106,15 +106,14 @@ Copy and paste the following multi-line input in the Azure CLI, and update the v
When you deploy your application pods, the manifest should reference the service account created in the **Create Kubernetes service account** step. The following manifest shows how to reference the account, specifically *metadata\namespace* and *spec\serviceAccountName* properties:
142
+
143
+
```yml
144
+
cat <<EOF | kubectl apply -f -
145
+
apiVersion: v1
146
+
kind: Pod
147
+
metadata:
148
+
name: quick-start
149
+
namespace: SERVICE_ACCOUNT_NAMESPACE
150
+
labels:
151
+
azure.workload.identity/use: "true"
152
+
spec:
153
+
serviceAccountName: workload-identity-sa
154
+
EOF
155
+
```
156
+
142
157
> [!IMPORTANT]
143
158
> Ensure your application pods using workload identity have added the following label [azure.workload.identity/use: "true"] to your running pods/deployments, otherwise the pods will fail once restarted.
144
159
145
160
```azurecli-interactive
146
161
kubectl apply -f <your application>
147
162
```
148
163
164
+
To check whether all properties are injected properly by the webhook, use the [kubectl describe][kubectl-describe] command:
165
+
166
+
```bash
167
+
kubectl describe pod containerName
168
+
```
169
+
170
+
To verify that pod is able to get a token and access the resource, use the kubectl logs command:
171
+
172
+
```bash
173
+
kubectl logs containerName
174
+
```
175
+
149
176
## Optional - Grant permissions to access Azure Key Vault
150
177
151
178
This step is necessary if you need to access secrets, keys, and certificates that are mounted in Azure Key Vault from a pod. Perform the following steps to configure access with a managed identity. These steps assume you have an Azure Key Vault already created and configured in your subscription. If you don't have one, see [Create an Azure Key Vault using the Azure CLI][create-key-vault-azure-cli].
@@ -181,6 +208,7 @@ az aks update --resource-group myResourceGroup --name myAKSCluster --enable-work
181
208
In this article, you deployed a Kubernetes cluster and configured it to use a workload identity in preparation for application workloads to authenticate with that credential. Now you're ready to deploy your application and configure it to use the workload identity with the latest version of the [Azure Identity][azure-identity-libraries] client library. If you can't rewrite your application to use the latest client library version, you can [set up your application pod][workload-identity-migration] to authenticate using managed identity with workload identity as a short-term migration solution.
0 commit comments