- Take me to Practice Test
Solutions to practice test - OS Upgrades
-
Let us explore the environment first. How many nodes do you see in the cluster?
Details
``` $ kubectl get nodes ``` -
How many applications do you see hosted on the cluster?
Details
``` $ kubectl get deploy ``` -
Run the command 'kubectl get pods -o wide' and get the list of nodes the pods are placed on
Details
``` $ kubectl get pods -o wide ``` -
Run the command kubectl drain node01 --ignore-daemonsets
Details
``` $ kubectl drain node01 --ignore-daemonsets ``` -
Run the command 'kubectl get pods -o wide' and get the list of nodes the pods are placed on
Details
``` $ kubectl get pods -o wide ``` -
Run the command kubectl uncordon node01
Details
``` $ kubectl uncordon node01 ``` -
Run the command kubectl get pods -o wide
Details
``` $ kubectl get pods -o wide ``` -
Why are there no pods on node01?
Details
``` Only when new pods are created they will be scheduled ``` -
Use the command kubectl describe node master and look under taint section to check if it has any taints.
Details
``` $ kubectl describe node master ``` -
Run the command kubectl drain node02 --ignore-daemonsets
Details
``` $ kubectl drain node02 --ignore-daemonsets ``` -
Check the applications hosted on the node02.
Details
``` node02 has a pod not part of a replicaset $ kubectl get pods -o wide ``` -
Check the list of pods
Details
``` $ kubectl get pods -o wide ``` -
What would happen to hr-app if node02 is drained forcefully?
Details
``` $ kubectl drain node02 --ignore-daemonsets --force hr-app will be lost forever ``` -
Run the command kubectl drain node02 --ignore-daemonsets --force
Details
``` $ kubectl drain node02 --ignore-daemonsets --force ``` -
Run the command kubectl cordon node03
Details
``` $ kubectl cordon node03 ```