Certified Kubernetes Administrator (CKA) Practice Test

1 / 20

Which command would you use to safely remove local data from a node while draining it?

kubectl drain --delete-local-data

Using the command that includes the `--delete-local-data` flag with `kubectl drain` is essential for properly managing data when preparing a node for maintenance. This command will safely remove local data when draining the node, making it particularly useful in scenarios where persistent volumes or local storage might cause issues if the node is not drained correctly.

The `kubectl drain` command is used to gracefully remove workloads from a node, ensuring that any Pods running on that node are either terminated or rescheduled to other nodes in the cluster. By adding the `--delete-local-data` option, the command explicitly instructs Kubernetes to delete any local data stored on the node that doesn't have proper replication or backup. This is critical when dealing with stateful applications that could lose important data if not managed properly during a drain operation.

In contrast, other options either do not exist in Kubernetes terminology or would not have the desired effect on local data. For instance, commands that suggest simply removing local data or forcing a drain do not cater to the complexities of local storage management during node maintenance. Therefore, using `kubectl drain --delete-local-data` ensures that local data is removed in a controlled manner, aligning with best practices for maintaining cluster integrity and reliability.

Get further explanation with Examzify DeepDiveBeta

kubectl remove-local-data

kubectl force drain

kubectl drain with force option

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy