delete_cluster.yaml is used to uninstall the entire Kubernetes cluster and its related components, supporting selective resource cleanup based on configuration.
-
Global Initialization
- Execute the
native/rootrole on all nodes. - Load the
defaultsrole on all nodes.
- Execute the
-
Uninstall Kubernetes and Container Runtime
- For nodes in the
k8s_clustergroup, execute:uninstall/kubernetes: Uninstall Kubernetes components.uninstall/cri: Uninstall the container runtime (triggered only whendelete.criistrueand the current node does not belong to theimage_registrygroup).
- For nodes in the
-
Clean Local DNS Configuration
- Clean up locally-written DNS (hosts) marker segments on nodes to be uninstalled.
- Triggered only when
delete.dnsistrue.
-
Uninstall etcd (external mode only)
- Execute
etcd/scaling_downfor nodes in theetcdgroup. - Triggered only when
delete.etcdistrueandetcd.deployment_typeisexternal.
- Execute
-
Uninstall Image Registry
- Execute
uninstall/image-registryfor nodes in theimage_registrygroup. - Triggered only when
delete.image_registryistrue.
- Execute
- Please confirm that important data has been backed up before deleting the cluster.
- You can control whether to clean up corresponding resources through the
deleteconfiguration items (e.g.delete.cri,delete.etcd,delete.dns,delete.image_registry).