Skip to content

Instantly share code, notes, and snippets.

@silenceshell
Created July 17, 2019 03:45
Show Gist options
  • Save silenceshell/2a65d4198f9f19789f6dfa880721a604 to your computer and use it in GitHub Desktop.
Save silenceshell/2a65d4198f9f19789f6dfa880721a604 to your computer and use it in GitHub Desktop.
kubectl get pods --all-namespaces -o=json | jq -c '.items[] | {name: .metadata.name, namespace: .metadata.namespace, claimName: .spec | select( has ("volumes") ).volumes[] | select( has ("persistentVolumeClaim") ).persistentVolumeClaim.claimName }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment