Use context: kubectl config use-context k8s-c1-H
The metrics-server has been installed in the cluster. Your college would like to know the kubectl commands to:
show Nodes resource usage show Pods and their containers resource usage Please write the commands into /opt/course/7/node.sh and /opt/course/7/pod.sh.
译文:
在集群中已经安装了metrics-server。你们学院想知道kubectl的命令。
- 显示节点资源使用情况
- 显示Pod和其容器的资源使用情况
请将这些命令写入/opt/course/7/node.sh 和 /opt/course/7/pod.sh 。
解答:
参考: kubectl top node -h kubectl top pod -h
kubectl top node
echo "kubectl top node" > /opt/course/7/node.sh
kubectl top pod --containers=true
echo "kubectl top pod --containers=true" > /opt/course/7/pod.sh