question

CreatieZo avatar image
0 Votes"
CreatieZo asked srbose-msft commented

I can't delet my AKS cluster

I can't delete my AKS cluster. When I try to delete it, it shows

"value": "InternalServerError",
"localizedValue": "Internal Server Error (HTTP Status Code: 500)"


I tried to delete it from portal, bash and powershell . All failed. :(


{
"authorization": {
"action": "Microsoft.ContainerService/managedClusters/delete",
"scope": "/subscriptions/d49e9266-e558-455c-bbd1-6828545bd573/resourceGroups/KubernetesCluster_group/providers/Microsoft.ContainerService/managedClusters/KBCluster"
},
"caller": "xxxx@xxxx.xxxx",
"channels": "Operation",
"claims": {
"aud": "https://management.core.windows.net/",
"iss": "https://sts.windows.net/5cef9eec-36db-462e-bd56-0919beab92f4/",
"iat": "1635814455",
"nbf": "1635814455",
"exp": "1635818355",
"http://schemas.microsoft.com/claims/authnclassreference": "1",
"aio": "AWQAm/8TAAAAAO1RMONhcpDoIrr/eUhpK9mOXgneJ+48turh7nMUE4PZwO1nsyGMGZCLFcd5g379XDXAedn1NJpCQn56bEdRJRWv5lGgiEkkTPx5AR6Z2h5J0YkhFSQZc4Qdv4w6lwuQ",
"altsecid": "1:live.com:0002010001DCE1D9",
"http://schemas.microsoft.com/claims/authnmethodsreferences": "pwd,mfa",
"appid": "c44b4083-3bb0-49c1-b47d-974e53cbdf3c",
"appidacr": "2",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress": "xxx@xxxx.xxxx",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname": "Zo",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname": "Creatie",
"groups": "d6c99219-efcc-47a2-9bd7-d56a1e1c5b89",
"http://schemas.microsoft.com/identity/claims/identityprovider": "live.com",
"ipaddr": "103.73.242.59",
"name": "Zo Creatie",
"http://schemas.microsoft.com/identity/claims/objectidentifier": "3d57741f-0f3d-4209-a0cf-cf62cda076ca",
"puid": "10032000A2AAB25F",
"rh": "0.AUoA7J7vXNs2Lka9VgkZvquS9INAS8SwO8FJtH2XTlPL3zxKAH4.",
"http://schemas.microsoft.com/identity/claims/scope": "user_impersonation",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "yYQgR4zvKnPxeyswqydGdPH7O5iFReNe4mrqjo_OTKA",
"http://schemas.microsoft.com/identity/claims/tenantid": "5cef9eec-36db-462e-bd56-0919beab92f4",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name": "live.com#xxx@xxxx.xxxx",
"uti": "Qn7-C-LX2UyPDgh4UrhHAQ",
"ver": "1.0",
"wids": "62e90394-69f5-4237-9190-012177145e10",
"xms_tcdt": "1583829551"
},
"correlationId": "9a82a50e-3e73-4f87-97e6-bbb549e7bc1c",
"description": "",
"eventDataId": "404c36ae-ee4d-432c-8a53-bb2c87e1ba2b",
"eventName": {
"value": "EndRequest",
"localizedValue": "End request"
},
"category": {
"value": "Administrative",
"localizedValue": "Administrative"
},
"eventTimestamp": "2021-11-02T01:31:23.9079162Z",
"id": "/subscriptions/d49e9266-e558-455c-bbd1-6828545bd573/resourceGroups/KubernetesCluster_group/providers/Microsoft.ContainerService/managedClusters/KBCluster/events/404c36ae-ee4d-432c-8a53-bb2c87e1ba2b/ticks/637714134839079162",
"level": "Error",
"operationId": "9a82a50e-3e73-4f87-97e6-bbb549e7bc1c",
"operationName": {
"value": "Microsoft.ContainerService/managedClusters/delete",
"localizedValue": "Delete Managed Cluster"
},
"resourceGroupName": "KubernetesCluster_group",
"resourceProviderName": {
"value": "Microsoft.ContainerService",
"localizedValue": "Microsoft.ContainerService"
},
"resourceType": {
"value": "Microsoft.ContainerService/managedClusters",
"localizedValue": "Microsoft.ContainerService/managedClusters"
},
"resourceId": "/subscriptions/d49e9266-e558-455c-bbd1-6828545bd573/resourceGroups/KubernetesCluster_group/providers/Microsoft.ContainerService/managedClusters/KBCluster",
"status": {
"value": "Failed",
"localizedValue": "Failed"
},
"subStatus": {
"value": "InternalServerError",
"localizedValue": "Internal Server Error (HTTP Status Code: 500)"
},
"submissionTimestamp": "2021-11-02T01:33:03.1830234Z",
"subscriptionId": "d49e9266-e558-455c-bbd1-6828545bd573",
"tenantId": "5cef9eec-36db-462e-bd56-0919beab92f4",
"properties": {
"statusCode": "InternalServerError",
"serviceRequestId": "540a30a5-0fc5-4671-8e25-5d74a553daee",
"statusMessage": "{\"code\":\"InternalOperationError\",\"message\":\"Internal server error\"}",
"eventCategory": "Administrative",
"entity": "/subscriptions/d49e9266-e558-455c-bbd1-6828545bd573/resourceGroups/KubernetesCluster_group/providers/Microsoft.ContainerService/managedClusters/KBCluster",
"message": "Microsoft.ContainerService/managedClusters/delete",
"hierarchy": "d49e9266-e558-455c-bbd1-6828545bd573"
},
"relatedEvents": []
}



azure-kubernetes-service
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@CreatieZo , if and only if the resource group does not contain any other resources can you please try deleting the resource group? If it does not help, please create an AKS cluster with the same name in the same resource group with 1 node and then retry deleting the cluster. Please check if this helps.

0 Votes 0 ·
learn2skills avatar image
0 Votes"
learn2skills answered CreatieZo commented

Hi @CreatieZo

Please try using az aks delete and it worked! It looks like reconciling the cache worked.


If the Answer is helpful, please click Accept Answer and up-vote, so that it can help others in the community looking for help on similar topics.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I tried az aks delete and Remove-AzAksCluster.

It shows

(ResourceNotFound) The Resource 'Microsoft.ContainerService/managedClusters/KBCluster' under resource group 'MC_KubernetesCluster_group_KBCluster_westus2' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix


But the resource group MC_KubernetesCluster_group_KBCluster_westus2 is already deleted.

In portal, KBCluster is in the "KubernetesCluster_group" resource group.

0 Votes 0 ·
CreatieZo avatar image
0 Votes"
CreatieZo answered CreatieZo edited

Hi, @learn2skills

I tried az aks delete and Remove-AzAksCluster.

It shows

(ResourceNotFound) The Resource 'Microsoft.ContainerService/managedClusters/KBCluster' under resource group 'MC_KubernetesCluster_group_KBCluster_westus2' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix


But the resource group MC_KubernetesCluster_group_KBCluster_westus2 is already deleted.

In console, KBCluster is in the "KubernetesCluster_group" resource group.



if I run 'az aks list', it will get below list. BUT The resource group MC_KubernetesCluster_group_KBCluster_westus2 is already deleted.

PS /home/zo> az aks list
[
{
"aadProfile": null,
"addonProfiles": {
"azurepolicy": {
"config": null,
"enabled": false,
"identity": null
},
"httpApplicationRouting": {
"config": null,
"enabled": false,
"identity": null
},
"omsAgent": {
"config": {
"logAnalyticsWorkspaceResourceID": "/subscriptions/d49e9266-e558-455c-bbd1-6828545bd573/resourceGroups/DefaultResourceGroup-WUS2/providers/Microsoft.OperationalInsights/workspaces/DefaultWorkspace-d49e9266-e558-455c-bbd1-6828545bd573-WUS2"
},
"enabled": true,
"identity": {
"clientId": "ba59384f-52cd-4739-8ca8-c5f57c65cbfd",
"objectId": "4edc3da1-020b-4fad-8ce4-e9437f0efec2",
"resourceId": "/subscriptions/d49e9266-e558-455c-bbd1-6828545bd573/resourcegroups/MC_KubernetesCluster_group_KBCluster_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/omsagent-kbcluster"
}
}
},
"agentPoolProfiles": null,
"apiServerAccessProfile": {
"authorizedIpRanges": null,
"enablePrivateCluster": false,
"enablePrivateClusterPublicFqdn": null,
"privateDnsZone": null
},
"autoScalerProfile": null,
"autoUpgradeProfile": null,
"azurePortalFqdn": "kbcluster-dns-fb646606.portal.hcp.westus2.azmk8s.io",
"disableLocalAccounts": null,
"diskEncryptionSetId": null,
"dnsPrefix": "KBCluster-dns",
"enablePodSecurityPolicy": null,
"enableRbac": true,
"extendedLocation": null,
"fqdn": "kbcluster-dns-fb646606.hcp.westus2.azmk8s.io",
"fqdnSubdomain": null,
"httpProxyConfig": null,
"id": "/subscriptions/d49e9266-e558-455c-bbd1-6828545bd573/resourcegroups/KubernetesCluster_group/providers/Microsoft.ContainerService/managedClusters/KBCluster",
"identity": {
"principalId": "0ef3e4ca-53eb-4ef2-97f6-b628434b2201",
"tenantId": "5cef9eec-36db-462e-bd56-0919beab92f4",
"type": "SystemAssigned",
"userAssignedIdentities": null
},
"identityProfile": {
"kubeletidentity": {
"clientId": "d73ff296-747d-4bc7-b934-334f65c00ce2",
"objectId": "70dc9d6d-f6f6-4f32-93f8-0bf440a0064e",
"resourceId": "/subscriptions/d49e9266-e558-455c-bbd1-6828545bd573/resourcegroups/MC_KubernetesCluster_group_KBCluster_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/KBCluster-agentpool"
}
},
"kubernetesVersion": "1.20.9",
"linuxProfile": null,
"location": "westus2",
"maxAgentPools": 100,
"name": "KBCluster",
"networkProfile": {
"dnsServiceIp": "10.0.0.10",
"dockerBridgeCidr": "172.17.0.1/16",
"loadBalancerProfile": {
"allocatedOutboundPorts": null,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/d49e9266-e558-455c-bbd1-6828545bd573/resourceGroups/MC_KubernetesCluster_group_KBCluster_westus2/providers/Microsoft.Network/publicIPAddresses/71cd2cfa-ae54-4e81-b908-e2929745f89c",
"resourceGroup": "MC_KubernetesCluster_group_KBCluster_westus2"
}
],
"idleTimeoutInMinutes": null,
"managedOutboundIPs": {
"count": 1
},
"outboundIPs": null,
"outboundIpPrefixes": null
},
"loadBalancerSku": "Standard",
"natGatewayProfile": null,
"networkMode": null,
"networkPlugin": "kubenet",
"networkPolicy": null,
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.0.0.0/16"
},
"nodeResourceGroup": "MC_KubernetesCluster_group_KBCluster_westus2",
"podIdentityProfile": null,
"powerState": {
"code": "Running"
},
"privateFqdn": null,
"privateLinkResources": null,
"provisioningState": "Failed",
"resourceGroup": "KubernetesCluster_group",
"securityProfile": null,
"servicePrincipalProfile": {
"clientId": "msi"
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"type": "Microsoft.ContainerService/ManagedClusters",
"windowsProfile": null
}
]

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.