GPU-Live/ephemeral_usage/pod_ephemeral_storage.sh

10 lines
356 B
Bash
Executable File

#!/bin/bash
# 모든 노드 순회
for n in $(kubectl get node -o name); do
# kubelet stats summary API 호출 후 Pod별 ephemeral-storage 사용량 추출
kubectl get --raw "/api/v1/nodes/${n##*/}/proxy/stats/summary" \
| jq -r '.pods[] | [.podRef.namespace, .podRef.name, ."ephemeral-storage".usedBytes] | @tsv'
done > pod_ephemeral_storage.tsv