Uninstall an AKS Edge Essentials cluster

This article describes how to uninstall AKS Edge Essentials.

Disconnect from Azure Arc

If you used Connect-AideArcKubernetes to connect to Azure Arc, run Disconnect-AideArcKubernetes to disconnect your cluster from Azure Arc. For a complete clean-up, delete the service principal and resource group you created for this example:

Disconnect-AideArcKubernetes

If you used Connect-AksEdgeArc to connect to Arc, run Disconnect-AksEdgeArc to disconnect your cluster from Azure Arc:

Disconnect-AksEdgeArc -JsonConfigFilePath .\aksedge-config.json

You can also manually remove the cluster from Arc using the Azure portal and delete the Arc pods in the cluster.

Remove your application from cluster

Delete the applications that you deployed using the following command:

kubectl delete -f ./path-to-your-YAML-file/app.yaml

For example, if you deployed the sample Linux application, you can delete it using:

kubectl delete -f linux-sample.yaml

Remove nodes on a single-machine cluster

To remove the Windows node only, issue the following command:

Remove-AksEdgeNode -nodeType Windows

To remove your single machine cluster with a Linux or LinuxandWindows workload, run:

Remove-AksEdgeDeployment

# or run
Remove-AksEdgeDeployment -Force #to forcefully remove all.

You can't remove the Linux node alone in this configuration; you must remove the deployment if you need to remove Linux node.

Note

If your single-machine cluster doesn't clean up properly, run hnsdiag list networks, then delete any existing AKS Edge Essentials network objects using hnsdiag delete networks <ID>.

Note

There is a known issue in which repeatedly creating a new deployment and removing the node might result in an "error during ConnectToVirtualMachine." If this occurs, reboot your system to resolve the error.

Remove nodes on a multi-machine cluster

Be careful when removing control plane nodes. Make sure you have another working control plane node before doing so.

To remove a Windows-only node:

Remove-AksEdgeNode -NodeType Windows

To remove a Linux-only node:

Remove-AksEdgeNode -NodeType Linux

During the removal of a control plane node from a cluster, it's important for the cluster administrator to verify that the cluster has completed reconciliation and that the removed node no longer serves as the leader.

You can verify this by running kubectl get leases -A and checking until the removed node is no longer a lease holder in the output. This is vital for maintaining cluster stability.

To remove both nodes:

Remove-AksEdgeDeployment

Note

There is a known issue in which repeatedly creating a new deployment and removing the node can result in an error. If this occurs, reboot your system to resolve the error.

Uninstall AKS Edge Essentials

On your machine, go to Settings > Apps > Apps & Features. Alternatively, you can also go to Control Panel > Uninstall a Program. From there, look for Azure Kubernetes Service Edge Essentials (Public Preview). Select Uninstall.

Note

You might want to reboot your machine right after the uninstall so that all resources are cleaned up, and your machine is ready for a new installation.

If you encounter any issues uninstalling AKS Edge Essentials, try downloading this troubleshooting tool to uninstall.

Uninstall Azure CLI

See Uninstall Azure CLI.

Uninstall Az PowerShell

See How to uninstall Azure PowerShell modules.

Next steps

Overview