该命令类似于linux–top命令,用于显示node和pod的CPU和内存使用情况
/opt/kubernetes/bin/kubectl --kubeconfig /opt/kubernetes/conf/default-admin.kubeconfig top pod --help
/opt/kubernetes/bin/kubectl --kubeconfig /opt/kubernetes/conf/default-admin.kubeconfig top node --help
kubectl top pod podname
kubectl top pod -l name=mylabel
–sort-by=‘’: If non-empty, sort nodes list using specified field. The field can be either ‘cpu’ or ‘memory’
使用指定的属性排序,可以指定cpu或者memory