exam questions

Exam CKA All Questions

View all questions & answers for the CKA exam

Exam CKA topic 1 question 2 discussion

Actual exam question from CNCF's CKA
Question #: 2
Topic #: 1
[All CKA Questions]

SIMULATION -


Task -
Set the node named ek8s-node-0 as unavailable and reschedule all the pods running on it.

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Meliodas12
Highly Voted 1 year, 9 months ago
Do you really need to uncordon it? The task is only to mark the node unschedulable and reschedule all the running pods on it. It should be done by issuing: # drain node <node_name> --ignore-daemonsets
upvoted 16 times
femijohn123
1 year, 4 months ago
But the command will only mark the node schedulingDisabled how do we now reschedule the pods?
upvoted 1 times
importme
9 months, 4 weeks ago
drain will safely evict all of the pods from a node, if there are daemon set-managed pods, drain will not proceed without using --ignore-daemonsets flag
upvoted 1 times
...
VivekSolutionArchitect
1 year, 2 months ago
The key thing here is to reschedule all POD's, if cluster has only single node and the controlplane then POD's won't get scheduled to controlplane. In this case either taints will need to be removed from controlplane or need to add tolerations to POD so that they can be scheduled on controlplane.
upvoted 2 times
Portman
1 year, 2 months ago
You are absolutely right. In my case, there where 3 nodes (1 master and 2 worker) so just cordon and then drain (i know drain alone can do the job, but cordon first and then drain is more complete) the worker node
upvoted 2 times
...
...
...
...
gtsvetko
Highly Voted 1 year, 9 months ago
k cordon ek8s-node-0 k drain ek8s-node-0 --delete-local-data --ignore-daemonsets --force
upvoted 13 times
Stunomatic
1 year, 1 month ago
i think you are right because its asking to rescheduling all pods which are running on ek8s-node-0 so when we cordon it pods will automatically rescheduling on another node.
upvoted 2 times
Devch0801
5 months, 2 weeks ago
When we cordon the node it only marks node as unschedulable. It doesn't automatically reschedule the pods to another node.
upvoted 2 times
...
...
...
nahid0002
Most Recent 1 month, 2 weeks ago
kubectl cordon ek8s-node-1 kubectl drain ek8s-node-1 --ignore-daemonsets --force
upvoted 1 times
...
HaiNgo
4 months, 3 weeks ago
We have 2 statements. - drain ek8s-node-0 as unavailable - kubectl drain ek8s-node-0 —ignore-daemonsets - reschedule all the pods running on it - kubectl uncordon ek8s-node-0 - kubectl drain ek8s-master-0 —ignore-daemonsets - kubectl drain ek8s-node-1 —ignore-daemonsets
upvoted 1 times
...
charlilec
7 months, 1 week ago
should we edit all pods one by one and write tolerations same as taint on ek8s-node-0?? after drain??
upvoted 1 times
...
Kk14
8 months, 2 weeks ago
Drain marks the node as unschedulable and also evict pods on the node. While, cordon, only marks the node as unschedulable. Hence, kubectl drain <node name> --ignore-daemonsets, would work in this case and also questions refers to only pods and not all objects.
upvoted 2 times
...
anhayg
8 months, 3 weeks ago
This question can be tricky with pods that are NOT created as part of replicaSets. Then the pods will be terminated only and not rescheduled on other nodes. That needs to be checked before draining the node.
upvoted 2 times
...
Natraj007
9 months, 1 week ago
# Mark the node as unschedulable kubectl cordon ek8s-node-0 # Delete all pods running on the node kubectl delete pods --all --grace-period=0 --force --field-selector spec.nodeName=ek8s-node-0
upvoted 1 times
...
Stargazer11
11 months, 2 weeks ago
No need to uncordon it. Draining the node will evict the nodes and mark it unschedulable. # k drain <node_name> --ignore-daemonsets # k get nodes # k get pods -o wide (make sure existing pods are on other nodes)
upvoted 3 times
...
botsokui
1 year, 5 months ago
don't need to run cordon if you're going to drain it. Drain will do it then evict all the pods in the node. I'm confused the question didn't say we have to uncordon it eventually, why some comments are saying that we need to uncordon the node?
upvoted 6 times
...
real111
1 year, 5 months ago
As i read this question i see that there are two actions required - make unavailable and reschedule. To make unavailable (or unschedulable) we need to cordon it and then drain, no?
upvoted 2 times
...
real111
1 year, 9 months ago
would this be correct: K get nodes K drain ek8s-node-0 –ignore-demosets Mark the node as unschedulable: kubectl cordon ek8s-node-0 Delete the node: kubectl delete node ek8s-node-0 kubectl get pods -o wide
upvoted 3 times
spocknimoy
1 year, 5 months ago
I guess You Shouldnt delete node
upvoted 5 times
...
...
Hamiltonian
2 years, 1 month ago
dont forget to uncordon the node so that rescheudling can occur
upvoted 4 times
iiiaz
1 year, 5 months ago
The task does not asks to make it back available! I guess the exam checker will compare the LAST state of the node when ending the exam. If the node is uncordoned, how can the exam checker know that at some moment the node had been unscheduable. I do not see the point of uncordon it.
upvoted 5 times
...
...
not4me
2 years, 1 month ago
It doesn’t matter, focus on how to solve it instead of node names
upvoted 1 times
...
gcpengineer
2 years, 2 months ago
isnt this should be node-0?
upvoted 7 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago