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-migrate-from-pod-identity.md
+43-10Lines changed: 43 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,52 @@
1
1
---
2
-
title: Modernize your Azure Kubernetes Service (AKS) application with a workload identity sidecar
3
-
description: In this Azure Kubernetes Service (AKS) article, you learn how to configure your Azure Kubernetes Service pod to authenticate with the workload identity sidecar.
2
+
title: Modernize your Azure Kubernetes Service (AKS) application to use workload identity
3
+
description: In this Azure Kubernetes Service (AKS) article, you learn how to configure your Azure Kubernetes Service pod to authenticate with workload identity.
4
4
services: container-service
5
5
ms.topic: article
6
-
ms.date: 09/29/2022
6
+
ms.date: 11/3/2022
7
7
---
8
8
9
-
# Modernize application authentication with workload identity sidecar
9
+
# Modernize application authentication with workload identity
10
10
11
-
If your Kubernetes application runs on Azure Kubernetes Service (AKS) and is using a managed identity to securely access resources in Azure, you can set up a migration sidecar ensuring a smooth transition using the new Azure Identity SDK and minimize downtime. This sidecar intercepts Instance Metadata Service (IMDS) traffic and routes them to Azure Active Directory (Azure AD) using OpenID Connect (OIDC). This enables you to migrate from using managed identity with pod identity to workload identity, until you can migrate your applications to use the latest version of Azure Identity SDK.
12
-
13
-
This article shows you how to set up your application pod to authenticate using managed identity with workload identity as a short-term migration solution.
11
+
This article focuses on pod-managed identity migration to Azure Active Directory (Azure AD) workload identity (preview) for your Azure Kubernetes Service (AKS) cluster. It also provides guidance depending on the version of the [Azure Identity][azure-identity-supported-versions] client library used by your container-based application.
14
12
15
13
[!INCLUDE [preview features callout](./includes/preview/preview-callout.md)]
16
14
17
15
## Before you begin
18
16
19
17
- The Azure CLI version 2.40.0 or later. Run `az --version` to find the version, and run `az upgrade` to upgrade the version. If you need to install or upgrade, see [Install Azure CLI][install-azure-cli].
20
18
19
+
## Migration scenarios
20
+
21
+
This section explains the migration options available depending on what version of the Azure Identity SDK is installed.
22
+
23
+
For either scenario, you need to have the federated trust set up before you update your application to use the workload identity. The following are the minimum steps required:
24
+
25
+
-[Create a managed identity](#create-a-managed-identity) credential.
26
+
- Associate the managed identity with the kubernetes service account already used for the pod-manged identity or [create a new Kubernetes service account](#create-kubernetes-service-account) and then associate it with the managed identity.
27
+
-[Establish a federated trust relationship](#establish-federated-identity-credential-trust) between the managed identity and Azure AD.
28
+
29
+
### Migrate from latest version
30
+
31
+
If your cluster is already using the latest version of the Azure Identity SDK, perform the following steps to complete the authentication configuration:
32
+
33
+
- Deploy workload identity in parallel to where the trust is setup. You can restart your application deployment to begin using the workload identity, where it injects the OIDC annotations into the application automatically.
34
+
- After verifying the application is able to authenticate successfully, you can [remove the pod-managed identity](#remove-pod-managed-identity) annotations from your application and then remove the pod-managed identity add-on.
35
+
36
+
## Migrate from older version
37
+
38
+
If your cluster isn't using the latest version of the Azure Identity SDK, you have two options:
39
+
40
+
- You can use a migration sidecar that we provide, which converts the IMDS transactions your application makes over to [OpenID Connect][openid-connect-overview] (OIDC). The migration sidecar isn't intended to be a long-term solution, but a way to get up and running quickly on workload identity. Running the migration sidecar within your application proxies the application IMDS transactions over to OIDC. Perform the following steps to:
41
+
42
+
-[Deploy the workload with migration sidecar](#deploy-the-workload-with-migration-sidecar) to proxy the application IMDS transactions.
43
+
- Once you verify the authentication transactions are completing successfully, you can [remove the pod-managed identity](#remove-pod-managed-identity) annotations from your application and then remove the pod-managed identity add-on.
44
+
45
+
- Rewrite your application to support the latest version of the [Azure Identity][azure-identity-supported-versions] client library. Afterwards, perform the following steps:
46
+
47
+
- Restart your application deployment to begin authenticating using the workload identity.
48
+
- Once you verify the authentication transactions are completing successfully, you can [remove the pod-managed identity](#remove-pod-managed-identity) annotations from your application and then remove the pod-managed identity add-on.
49
+
21
50
## Create a managed identity
22
51
23
52
If you don't have a managed identity created and assigned to your pod, perform the following steps to create and grant the necessary permissions to storage, Key Vault, or whatever resources your application needs to authenticate with in Azure.
@@ -74,7 +103,7 @@ The following output resembles successful creation of the identity:
74
103
Serviceaccount/workload-identity-sa created
75
104
```
76
105
77
-
## Establish federated identity credential
106
+
## Establish federated identity credential trust
78
107
79
108
Use the [az identity federated-credential create][az-identity-federated-credential-create] command to create the federated identity credential between the managed identity, the service account issuer, and the subject. Replace the values `resourceGroupName`, `userAssignedIdentityName`, `federatedIdentityName`, `serviceAccountNamespace`, and `serviceAccountName`.
> It takes a few seconds for the federated identity credential to be propagated after being initially added. If a token request is made immediately after adding the federated identity credential, it might lead to failure for a couple of minutes as the cache is populated in the directory with old data. To avoid this issue, you can add a slight delay after adding the federated identity credential.
87
116
88
-
## Deploy the workload
117
+
## Deploy the workload with migration sidecar
89
118
90
119
If your application is using managed identity and still relies on IMDS to get an access token, you can use the workload identity migration sidecar to start migrating to workload identity. This sidecar is a migration solution and in the long-term applications, you should modify their code to use the latest Azure Identity SDKs that support client assertion.
91
120
@@ -175,6 +204,10 @@ This article showed you how to set up your pod to authenticate using a workload
Copy file name to clipboardExpand all lines: articles/aks/workload-identity-overview.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,8 +111,8 @@ The following table summarizes our migration or deployment recommendations for w
111
111
112
112
|Scenario |Description |
113
113
|---------|------------|
114
-
| New or existing cluster deployment [runs a supported version](#dependencies) of Azure Identity client library | No migration steps are required.<br> Sample deployment resources:<br> - [Deploy and configure workload identity on a new cluster][deploy-configure-workload-identity-new-cluster]<br> - [Tutorial: Use a workload identity with an application on AKS][tutorial-use-workload-identity]|
115
-
| New or existing cluster deployment [runs an unsupported version](#dependencies) of Azure Identity client library| Update container image to use a supported version of the Azure Identity SDK, or use the [migration sidecar][workload-identity-migration-sidecar]. |
114
+
| New or existing cluster deployment [runs a supported version][azure-identity-libraries] of Azure Identity client library | No migration steps are required.<br> Sample deployment resources:<br> - [Deploy and configure workload identity on a new cluster][deploy-configure-workload-identity-new-cluster]<br> - [Tutorial: Use a workload identity with an application on AKS][tutorial-use-workload-identity]|
115
+
| New or existing cluster deployment runs an unsupported version of Azure Identity client library| Update container image to use a supported version of the Azure Identity SDK, or use the [migration sidecar][workload-identity-migration-sidecar]. |
116
116
117
117
## Next steps
118
118
@@ -134,7 +134,7 @@ The following table summarizes our migration or deployment recommendations for w
0 commit comments