Kubernetes - 获取pod磁盘使用情况
2024-01-05
单位MB
node=10.3.80.6
kctl get --raw "/api/v1/nodes/${node}/proxy/stats/summary" | jq .pods | jq -r '.[] | "\(.podRef.name) | \(.containers[0].rootfs.usedBytes/1024/1024) | \(.containers[0].logs.usedBytes/1024/1024)"'| sort -rnk3
kctl get --raw "/api/v1/nodes/${node}/proxy/stats/summary" | jq .pods | jq -r '.[] | "\(.podRef.name) \(.containers[0].rootfs.usedBytes/1024/1024) "'| sort -rnk2
kctl get --raw "/api/v1/nodes/${node}/proxy/stats/summary" | jq .pods | jq -r '.[] | "\(.podRef.name) \(.containers[0].logs.usedBytes/1024/1024) "'| sort -rnk2