Restart, remove, or reinstall Azure Kubernetes Service

Applies to: AKS on Azure Stack HCI 22H2, AKS on Windows Server

After you deploy AKS Arc, you can restart, remove, or reinstall your deployment if necessary.

Restart AKS Arc

Restarting AKS Arc removes all of your Kubernetes clusters (if any) and the Azure Kubernetes Service host. The restart process also uninstalls the AKS agents and services from the nodes. Then, it repeats the original install process steps until the host is recreated. The AKS configuration that you configured via Set-AksHciConfig and the downloaded VHDX images are preserved. The Set-AksHciConfig command removes the current VMs and creates new ones.

To restart AKS Arc with the same configuration settings, run the following command:

Restart-AksHci

Remove AKS Arc

To remove AKS, run the following Uninstall-AksHci command. This command removes the old configuration, and you must run Set-AksHciConfig again when you reinstall.

If your clusters are Arc-enabled, delete any Azure resources before proceeding. To delete any associated Arc resources for your on-premises cluster, follow the guidance for cleaning up Azure Arc resources.

Uninstall-AksHci

If you want to retain the old configuration, run the following command:

Uninstall-AksHci -SkipConfigCleanup

Reinstall configuration settings and AKS Arc

To reinstall AKS Arc after uninstalling it, follow these instructions.

If you ran the Uninstall-AksHci command with the -SkipConfigCleanup parameters, your old configuration settings were retained. To reinstall, run the following command:

Install-AksHci

If you didn't use the -SkipConfigCleanup parameter when uninstalling, then you must reset your configuration settings with the following commands. This example command creates a virtual network with a static IP address. If you want to configure your AKS deployment with DHCP, see new-akshcinetworksetting for examples of how to configure DHCP.

#static IP
$vnet = New-AksHciNetworkSetting -name myvnet -vswitchName "extSwitch" -k8sNodeIpPoolStart "172.16.10.0" -k8sNodeIpPoolEnd "172.16.10.255" -vipPoolStart "172.16.255.0" -vipPoolEnd
"172.16.255.254" -ipAddressPrefix "172.16.0.0/16" -gateway "172.16.0.1" -dnsServers "172.16.0.1"

Set-AksHciConfig -imageDir c:\clusterstorage\volume1\Images -workingDir c:\ClusterStorage\Volume1\ImageStore -cloudConfigLocation c:\clusterstorage\volume1\Config -vnet $vnet -cloudservicecidr "172.16.10.10/16"

Install-AksHci

Next steps

In this article, you learned how to restart, remove, or reinstall Azure Kubernetes Service in AKS hybrid. Next, you can: