New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Docker DCA Exam - Topic 4 Question 83 Discussion

Actual exam question for Docker's DCA exam
Question #: 83
Topic #: 4
[All DCA Questions]

You are running only Kubernetes workloads on a worker node that requires

maintenance, such as installing patches or an OS upgrade.

Which command must be run on the node to gracefully terminate all pods on

the node, while marking the node as unschedulable?

Show Suggested Answer Hide Answer
Suggested Answer: C

The command kubectl drain <node name> is the correct one to run on the node to gracefully terminate all pods on the node, while marking the node as unschedulable. This command will safely evict all the pods from the node before you perform maintenance on the node, such as installing patches or an OS upgrade1. It will respect the PodDisruptionBudgets you have specified, if any, and allow the pod's containers to gracefully terminate1. It will also mark the node as unschedulable, so that no new pods can be scheduled on the node until it is ready1.

The other commands are not correct because:

* docker swarm leave will make the node leave the swarm cluster, but it will not affect the Kubernetes workloads on the node2.

* docker node update -availability drain <node name> will change the availability of the node to drain, which means that no new tasks can be assigned to the node, but it will not terminate the existing pods on the node3.

* kubectl cordon <node name> will mark the node as unschedulable, but it will not evict the pods on the node4.


* Safely Drain a Node | Kubernetes

* [docker swarm leave | Docker Docs]

* [docker node update | Docker Docs]

* [kubectl cordon | Kubernetes Docs]

Contribute your Thoughts:

0/2000 characters
King
3 months ago
I didn't know that! Thanks for clarifying!
upvoted 0 times
...
Bette
3 months ago
No doubt, `kubectl drain` is the way to go for maintenance.
upvoted 0 times
...
Ivan
4 months ago
Wait, are you sure? I thought `kubectl cordon` was enough.
upvoted 0 times
...
Renay
4 months ago
Agreed, that's the right command for draining pods!
upvoted 0 times
...
Dorinda
4 months ago
It's definitely `kubectl drain `.
upvoted 0 times
...
Carylon
4 months ago
I'm a bit confused about the difference between `drain` and `cordon`. I think `drain` is what we want here, but I should double-check that.
upvoted 0 times
...
Francine
5 months ago
I feel like `kubectl cordon ` just marks the node as unschedulable without terminating the pods, so it can't be the answer.
upvoted 0 times
...
Alva
5 months ago
I remember practicing a similar question, and I believe `kubectl drain` is the right choice to gracefully terminate pods.
upvoted 0 times
...
Yen
5 months ago
I think the command we need is related to Kubernetes, so it might be `kubectl drain `, but I'm not entirely sure.
upvoted 0 times
...
Elena
5 months ago
Okay, I've seen this type of scenario before. I believe the correct answer is `kubectl drain `. This command will safely evict all pods from the node, allowing them to be rescheduled on other nodes, and then mark the node as unschedulable.
upvoted 0 times
...
Delfina
5 months ago
Hmm, this seems to be testing our knowledge of Kubernetes node management. I think the key here is to find the command that can gracefully terminate all pods on the node while marking it as unschedulable. Let me think this through.
upvoted 0 times
...
Tomas
5 months ago
This looks like a Kubernetes-related question, so I'll need to think about the specific Kubernetes commands that would handle this scenario. I'm a bit unsure about the exact command, but I'll try to reason through it.
upvoted 0 times
...
Stephaine
5 months ago
I'm pretty confident the answer is `kubectl drain `. This is the standard Kubernetes command for gracefully draining a node, which will ensure all pods are terminated and rescheduled before the node is marked as unschedulable for maintenance.
upvoted 0 times
...
Eladia
5 months ago
Hmm, this seems like a tricky one. I'm not sure if enabling developer mode in Production is the best idea, but it might be worth a try to get the required information.
upvoted 0 times
...
Rosann
5 months ago
This seems straightforward. I'm pretty sure Salesforce allows you to merge up to 3 records at a time, so the answer should be "True".
upvoted 0 times
...
Virgie
5 months ago
This looks like a tricky accounting question involving prior period adjustments. I'll need to carefully review the information provided and think through the impact on the financial statements.
upvoted 0 times
...
Selene
2 years ago
I believe `kubectl cordon ' only marks the node as unschedulable without gracefully terminating the pods. So, the correct answer should be C.
upvoted 0 times
...
Tiffiny
2 years ago
But what about option D) `kubectl cordon '? Would that also work for marking the node as unschedulable?
upvoted 0 times
...
Beata
2 years ago
I agree with Dianne. Running `kubectl drain ' will gracefully terminate all pods on the node.
upvoted 0 times
...
Dianne
2 years ago
I think the correct answer is C) `kubectl drain '.
upvoted 0 times
...
Vernell
2 years ago
Yes, `kubectl cordon ' can mark the node as unschedulable, but `kubectl drain ' is the better choice for gracefully terminating pods.
upvoted 0 times
...
Jose
2 years ago
But isn't `kubectl cordon ' also a valid command to mark the node as unschedulable?
upvoted 0 times
...
Dulce
2 years ago
I agree with Vernell, using `kubectl drain ' will gracefully terminate all pods on the node.
upvoted 0 times
...
Vernell
2 years ago
I think the answer is C) `kubectl drain '.
upvoted 0 times
...

Save Cancel