15_get_metrics_server_stats.yml - Usage Guide
Purpose
If metrics-server is ready, reports node and pod CPU/memory usage via kubectl top in a readable form. If it is not installed, it does not install; it prints a warning (use 16 to install).
Shared tasks:
Report sections
| Section | Command | How to read |
|---|---|---|
| Node | kubectl top nodes | Instant CPU (cores) and MEMORY per node |
| Pod CPU | kubectl top pods -A --sort-by=cpu | Highest CPU pods first |
| Pod memory | kubectl top pods -A --sort-by=memory | Highest RAM pods first |
Values are instantaneous (metrics-server scrapes ~15s); this is not a long-term graph. Interpret high usage together with 10 / 11.
Requirements
master/singlenode, first control-plane- metrics-server must be READY (
Available=True). If not, use 14 or 16.
How to run
ansible-playbook -i inventories/cagatayuresincom/hosts.ini playbooks/15_get_metrics_server_stats.yml
Notes
- Right after a fresh install you may see “no data”; waiting ~1 minute and re-running 15 is enough.
- Read-only.