Kubernetes Lab Cleanup Kubernetes Cluster
1. Drain the Node Draining a node ensures that workloads are safely evicted before cleaning its configuration: kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data Notes --ignore-daemonsets: Ensures that DaemonSet pods are not deleted. --delete-emptydir-data: Deletes data in emptyDir volumes. ⚠️ Warning: If the node is a control plane node, use --force with caution. 2. Remove the Node from the Cluster To remove the node from the cluster, run: kubectl delete node <node-name> This will delete the node’s representation in the Kubernetes API. ...