본문 바로가기
cloud/k8s(문제풀이)

[cka]kodekloud-os UPgrade

by mozi2 2022. 6. 21.
반응형

1.Let us explore the environment first. How many nodes do you see in the cluster?

   Including the controlplane and worker nodes.

# k get nodes

A) 2

 

2. How many nodes are part of this cluster?  Including master and worker nodes

# k get nodes

A) 1

 

3. Which nodes are the applications hosted on?

# k get nodes -o wide

A) controlplane, node01 

 

3-1.How many nodes can host workloads in this cluster?

Inspect the applications and taints set on the nodes.

 # k describe node | grep Taints

A) 2 

3-2.How many applications are hosted on the cluster?

Count the number of deployments.

# k get deployments

A) 1

 

 

4. We need to take node01 out for maintenance. Empty the node of all applications and mark it unschedulable.

  • Node node01 Unschedulable
  • Pods evicted from node01

 : 모든 AP 의 노드를 비우고, unschedulable상태로 만들기 

# k drain node01 --ignore-daemonsets

(전)

 (후)

5. What nodes are the pods hosted on?

# k get nodes -o wide

A) controlplane

 

6. The maintenance tasks have been completed. Configure the node node01 to be schedulable again.

: 4번에서 unschedule 한것을 다시 schedule 를 해라

  • Node01 is Schedulable
# k uncordon node01
# k get nodes

7. How many pods are scheduled on node01 now?

# k get nodes

A) 0

 

8. Why are there no pods on node01?

 

A) Only when new pods are created they will be scheduled 

 

9.Why are the pods placed on the controlplane node?

Check the controlplane node details.

 

A) controlplane node does not have any taints

 

10. Time travelling to the next maintenance window…

: 약간의 시간 후에 okay 누르면 됨

 

11.We need to carry out a maintenance activity on node01 again.

Try draining the node again using the same command as before: kubectl drain node01 --ignore-daemonsets

Did that work?

# k drain node01 --ignore--daemonsets

: 명령어 작동 후 "unable to drain ~~" 을 확인 할 수 있다.

 

A) NO

 

12. Why did the drain command fail on node01? It worked the first time!

A) there is a pod in node01 which is not partt of a replicaset

 

13.What is the name of the POD hosted on node01 that is not part of a replicaset?

# k get pods -o wide

A) hr-app

 

14.What would happen to hr-app if node01 is drained forcefully?

Try it and see for yourself.

 

A) hr-app will be lost forever 

 

15. Oops! We did not want to do that! hr-app is a critical application that should not be destroyed. We have now reverted back to the previous state and re-deployed hr-app as a deployment.

 

A) ok

 

16 hr-app is a critical app and we do not want it to be removed and we do not want to schedule any more pods on node01.

Mark node01 as unschedulable so that no new pods are scheduled on this node.

Make sure that hr-app is not affected.

  • Node01 Unschedulable

  • hr-app still running on node01?
# k cordon node01 

728x90
반응형