Lesson  in  CKA Mock Exam

Question 10: Node and Pod Resource Usage Scripts

Write two scripts that use kubectl to show live resource usage of Nodes and Pods via metrics-server.

The metrics-server has been installed in the cluster. Write two bash scripts which use kubectl:

  • Script /opt/node.sh should show resource usage of Nodes
  • Script /opt/pod.sh should show resource usage of Pods
Hint 1

Don't forget chmod +x — the scripts need to actually be executable, not just contain the right command.

Hint 2

Run each command manually first with no arguments and see what scope it defaults to. If that scope looks too narrow to call it "resource usage of Pods" in general, there's a flag for widening it.