Skip to content

Instantly share code, notes, and snippets.

@Prajithp
Created November 29, 2020 15:32
Show Gist options
  • Save Prajithp/90f293b91f5483d20ec2f1de7aa08938 to your computer and use it in GitHub Desktop.
Save Prajithp/90f293b91f5483d20ec2f1de7aa08938 to your computer and use it in GitHub Desktop.

Revisions

  1. Prajith created this gist Nov 29, 2020.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    kubectl get po --all-namespaces -o custom-columns=name:.metadata.name,status:.status.phase,image:'.spec.containers[0].image'
    kubectl get po -o json --all-namespaces | jq '.items | group_by(.spec.nodeName) | map({"nodeName": .[0].spec.nodeName, "count": length}) | sort_by(.count)'