Kubelet User Assigned Managed Identity
@Azure/aks-pm issue needs labels
Hi @palma21, I'm really waiting for this feature, could you share what is ETA to deliver ? In current state when using control plane BYO User Assigned Managed Identity, there are auto-generated 3 additional identities inside MC_ resource group: kubelet, azurepolicy (if using addon), omsagent (if configured) without any role assignments. It makes me unable to use POD Identity (installed myself from Helm Chart), it causes that kubelet identity does not have authorization to perform action 'Microsoft.Compute/virtualMachineScaleSets/write'.
Is there any other solution than assigning Contributor role to this auto-generated kubelet identity ?
This will be out in mid-Feb.
Hi @miwithro , is this feature released? I still see auto-created UAMI without any roles assigned.
Hi @miwithro , can you share any documentation about this feature?
https://docs.microsoft.com/en-us/azure/aks/use-managed-identity#bring-your-own-control-plane-mi
This guide does not replace the kubelet identity.
Tried workarounds that failed: I've tried installing the user assigned identity with aad-pod-identity (with helm not addon) and a dummy pod, binding the user assigned identity to the pod. But that does not seem to work for nodes and ACR, it does work for the pod.
Examples:
rg_name=Group-AKS-Lab
msi_name=msi-aks-lab
aks_name=aks-lab
az group create -n ${rg_name}
az identity create -n ${msi_name} -g ${rg_name}
msi_id=$(az identity show -n ${msi_name} -g ${rg_name} -o json --query id | jq -rc)
az aks create -n ${aks_name} -g ${rg_name} --enable-managed-identity --assign-identity ${msi_id}
az aks show -n ${aks_name} -g ${rg_name} -o json --query '{identity: identity, kubelet: identityProfile.kubeletidentity}'
Why we need this: We have a blue/green deploy on cluster level since AKS is so easy to work with along side Argocd and its gitops. If we need to do a cluster change, upgrade a ingress, cert-manager or any other major cluster breaking changes we do that in a new cluster. In order to preserve the RBAC for the cluster as well as enable aad-pod-identity we would like to use a user assigned identity for the kubelet, since this will have access to our teams ACR and MI.
microsoft.ContainerService/CustomKubeletIdentityPreview? :crossed_fingers: Datamining with az cli
az feature list -o json --query '[].name' | grep ContainerService | grep ubelet
I registered but haven't figured out how to use it yet:-)
@norshtein
Hi! Any documentation on how to use this? I really don't know how it can be called in public preview without any documentation:-)
Sorry to badger. Any documentation on this?
@jabbera not yet. As soon as it posted I will paste it here. Any day now.
Thank you for the update @miwithro this feature will make our dev and prod environments much easier to manage. Cheers!
Custom kubelet identity documentation is available here. https://docs.microsoft.com/en-us/azure/aks/use-managed-identity#bring-your-own-kubelet-mi-preview
@miwithro , as per documentation custom kubelet identity is supported for brand new aks cluster. But there is no support for updating existing cluster to use custom kubelet identity.
az aks update -g MyResourceGroup -n MyManagedCluster --enable-managed-identity --assign-identity <user_assigned_identity_resource_id>
It will be good to have --assign-kubelet-identity argument for updating cluster. Without this, we are forced to build new clusters on all our environments.
@miwithro can the arm template be used to set this as well? If so how?
@miwithro can the arm template be used to set this as well? If so how?
You can set kubelet identity at identityProfile under managedCluster properties.
"identityProfile": {
"kubeletidentity": {
"resourceId": "[parameters('kubeletUami').resourceID]",
"clientId": "[parameters('kubeletUami').clientID]",
"objectId": "[parameters('kubeletUami').objectID]"
}
}
This only works for new clusters. This is not designed for upgrading existing clusters.
@SatyKrish this works but you also need to assign the "Managed Identity Operator" role on the kublet identity to the cluster identity.
@miwithro yup! I just blew away the cluster and recreated it. I used the setting from @SatyKrish and combining that with assign "Managed Identity Operator" to the cluster identity all seems to work as expected.