cluster-api-provider-azure: Azure ManagedMachinePool provider id scheme is incompatible with capi

/kind bug /area managedclusters

What steps did you take and what happened: [A clear and concise description of what the bug is.] Create a managed cluster with one azuremanagedmachinepool [pool1] azuremanagedmachinepool and node refs are synced correctly

add one more azuremanagedmachinepool [pool2] pool2 status.nodeRef will have nodes from pool1

What did you expect to happen: pool2 status.nodeRef will have nodes from pool2

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.] I think this happens because the azure managedmachinepool node’s providerid is incompatible with capi providerid

Where capi expects last segment of providerid to be unique instance id https://github.com/kubernetes-sigs/cluster-api/blob/37c862b5c9256d7ae65cd8ee8ddd7a103d51fe90/controllers/noderefutil/providerid.go#L34-L40

azure providerid for managedmachinepoolnode is azure:///subscriptions/<subscription>resourceGroups/<resourcegroup>/providers/Microsoft.Compute/virtualMachineScaleSets/aks-newworkw7y1-28238572-vmss/virtualMachines/0

which capi parses as follows provider: azure id: 0

which causes noderef util in capi to match incorrect nodes in machinepoolstatus

Environment:

  • cluster-api-provider-azure version: 0.4.15
  • Kubernetes version: (use kubectl version): 1.21.1
  • OS (e.g. from /etc/os-release): ubuntu

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (16 by maintainers)

Most upvoted comments

@alexeldeib note : According to the comment above, the ideal fix would be using the whole providerID for comparison in the core capi library. This would still may be need a fix in capz. The providerId set in the node and ammp are still not exactly the same.

node: capi-infra provider: azure:///subscriptions/<subscriptionId>/resourceGroups/spc_mc_lochan-rg_rnl-aks_eastus/providers/Microsoft.Compute/virtualMachineScaleSets/aks-workerpm65h-31427834-vmss/virtualMachines/0 ammp: azure:///subscriptions/<subscriptionId>/resourceGroups/SPC_MC_lochan-rg_rnl-aks_eastus/providers/Microsoft.Compute/virtualMachineScaleSets/aks-workerpm65h-31427834-vmss/virtualMachines/0