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.shshould show resource usage of Nodes - Script
/opt/pod.shshould 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.
- Previous lesson
- Question 1: Namespace and Pod
- Next lesson
- Question 11: Pod Ready if Service is Reachable