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: docs/content/api-overview/resources/aks-cluster.md
+75Lines changed: 75 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,81 @@ let myAks = aks {
128
128
)
129
129
}
130
130
```
131
+
132
+
#### Granting AKS access to Azure Container Registry (ACR)
133
+
134
+
To allow an AKS cluster to pull container images from Azure Container Registry, you need to grant the **[AcrPull](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#acrpull)** role to the cluster's **kubelet identity**. The kubelet identity is used by the cluster to authenticate when pulling container images. This is a common requirement when deploying containerized applications.
The recommended approach is to create user-assigned managed identities for both the cluster and the kubelet. The kubelet identity is granted AcrPull access to pull container images. This ensures identities are available immediately without waiting for Azure AD propagation:
139
+
140
+
```fsharp
141
+
open Farmer
142
+
open Farmer.Builders
143
+
open Farmer.Arm.RoleAssignment
144
+
145
+
// Create an identity for kubelet (used to pull container images)
146
+
let kubeletMsi = createUserAssignedIdentity "kubeletIdentity"
147
+
// Create an identity for the AKS cluster
148
+
let clusterMsi = createUserAssignedIdentity "clusterIdentity"
149
+
150
+
// Give the AKS cluster's identity rights to manage the kubelet MSI
0 commit comments