delete aks Loadbalancer not possible

DuffnerM 0 Reputation points
2023-10-04T07:52:36.6833333+00:00

Hi,

I am desperately trying to delete a load balancer. It was connected to an AKS cluster which no longer exists.

When I try to delete it, I get the following error message:

Failed to delete load balancer 'kubernetes'. Error: Cannot delete load balancer MC_thankfuldune-c1515963-rg_thankfuldune-c1515963_westeurope/providers/Microsoft.Network/loadBalancers/kubernetes'>kubernetes since its child resources kubernetes,aksOutboundBackendPool,gfadgad are in use by virtual machine scale set /subscriptions/xxxx-xxxx/resourceGroups/MC_thankfuldune-c1515963-rg_thankfuldune-c1515963_westeurope/providers/Microsoft.Compute/virtualMachineScaleSets/aks-systempool-27307886-vmss.

However, the reported vmss no longer exists.

Does anyone have an idea how to get rid of the load balancer? Deleting the entire RG did not work either.

thanks

Manuel

PS. I cannot delete the backend pools. Because according to the error message, they are used by the machine scale set, which no longer exists.

Failed to delete load balancer backend pool Failed to delete load balancer backend pool 'aksOutboundBackendPool'. Error: Cannot remove backend address pool aksOutboundBackendPool from load balancer since it is in use by virtual machine scale set /subscriptions/xxxx-xxxx/resourceGroups/MC_thankfuldune-c1515963-rg_thankfuldune-c1515963_westeurope/providers/Microsoft.Compute/virtualMachineScaleSets/aks-systempool-27307886-vmss.

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,141 questions
Azure Load Balancer
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
449 questions
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
407 questions
{count} votes

3 answers

Sort by: Most helpful
  1. AlaaBarqawi_MSFT 942 Reputation points Microsoft Employee
    2023-10-15T08:56:18.8833333+00:00

    Hi @Manuel please do the following

    Remove load balancer associated with the VMSS:
    az vmss update --resource-group <<RESOURCE_GROUP_NAME>> --name <<VMSS_NAME>> --remove virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].ipConfigurations[0].loadBalancerBackendAddressPools 0

    Upgrade instances in the VMSS:
    az vmss update-instances --instance-ids "*" -n <<VMSS_NAME>> -g <<RESOURCE_GROUP_NAME>>

    Remove the load balancer:
    az network lb delete -g <<RESOURCE_GROUP_NAME>> -n <<LB_NAME>>

    I had success with this steps.

    1 person found this answer helpful.

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Dumitrel Popa 0 Reputation points
    2024-05-16T18:07:59.07+00:00

    @AlaaBarqawi_MSFT worked for me. You have to use show command to indetify the right resources, in my case it was not 0 but 4 and I have been able to deleted once I created the dependend resources.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.