简介
╰─➤ kubectl top --help
Display Resource (CPU/Memory) usage.
The top command allows you to see the resource consumption for nodes or pods.
This command requires Metrics Server to be correctly configured and working on the server.
Available Commands:
node Display resource (CPU/memory) usage of nodes
pod Display resource (CPU/memory) usage of pods
Usage:
kubectl top [flags] [options]
Use "kubectl <command> --help" for more information about a given command.
Use "kubectl options" for a list of global command-line options (applies to all commands).
查看node
/ # kubectl top node
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
devops-prod-master-1 3210m 6% 33845Mi 69%
devops-prod-master-2 2617m 5% 19375Mi 40%
devops-prod-master-3 2472m 31% 11755Mi 75%
查看pod
/ # kubectl top pod -A | grep cv-console-dev | grep rds
cv-console-dev cv-console-rds-6b97c64d87-v8djz 36m 522Mi
cv-console-dev cv-console-web-rds-77cc5d94fd-fwr2q 1m 25Mi