
#
kubectl get nodes -l uavcloud.env=demo

# 获取节点的lables
all_demo_nodelist=$(kubectl get nodes -l uavcloud.env=demo | grep -v NAME | awk '{print$1}')
for node in ${all_demo_nodelist[@]};do
    echo "node is $node"
    kubectl get nodes ${node} --show-labels
done

# 获取节点的资源信息
# 获取节点列表并存储到数组中
kubectl get nodes -l uavcloud.env=demo -o custom-columns=:metadata.name | while read -r node; do
    echo "node is $node"
    # kubectl get node ${node} -o json | jq '.status.capacity | {cpu: .cpu, memory: .memory}'
    ssh ${node} "df -TH"
    echo ""
done


kubectl get node demo-02.ecs.io -o json

all_demo_nodelist=(demo-02.ecs.io demo-03.ecs.io demo-05.ecs.io demo-07.ecs.io demo-08.ecs.io demo-09.ecs.io demo-231.ecs.io demo-232.ecs.io demo-233.ecs.io demo-234.ecs.io prod-02.ecs.io prod-04.ecs.io prod-05.ecs.io prod-07.ecs.io prod-09.ecs.io drone-48.ecs.io drone-49.ecs.io)

for node in ${all_demo_nodelist[@]};do
    echo "node is $node"
    ssh ${node} "df -TH"
    echo ""
    echo ""
done
chmod +x /root/wdd/ctop

Len3#io7%2k
