Skip to content

Container storage deployed as containers

List PVCs

Show node where local-storage PVC is located for a single PVC:

kubectl -n ci get pvc repocache -o=jsonpath='{.metadata.name} {.spec.volumeName} {.metadata.annotations.volume\.kubernetes\.io/selected-node}'

Show nodes where local-storage PVCs are located for a multiple PVCs, sorted by node:

kubectl get pvc -A -o=jsonpath='{range .items[*]}{.metadata.name} {.metadata.annotations.volume\.kubernetes\.io/selected-node}{"\n"}{end}' | sort -k 2