Skip to content

Instantly share code, notes, and snippets.

@ahmadidev
Last active May 2, 2022 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmadidev/9866f5b5993fde523c99ad6c869f38ea to your computer and use it in GitHub Desktop.
Save ahmadidev/9866f5b5993fde523c99ad6c869f38ea to your computer and use it in GitHub Desktop.
Get all containers in all namespaces with resources using jsonpath
kubectl get pod -o jsonpath="{range .items[*]}{'Namespace: '}{.metadata.namespace}{range .spec.containers[*]}{' Container:
'}{.name}{' Resources: '}{.resources}{'\n'}{end}{end}" -A
@ahmadidev
Copy link
Author

Sample output:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment