Skip to content

Commit

Permalink
added kubectl command to list images and containers
Browse files Browse the repository at this point in the history
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
  • Loading branch information
ivankatliarchuk committed Sep 5, 2024
1 parent 3f5b9a6 commit e7dedb2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shell/aliase/kube
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ alias k.img-n="kubectl get pods -o jsonpath='{..image}' | tr -s '[[:space:]]' '\
alias k.img-a="kubectl get pods -o jsonpath='{..image}' -A | tr -s '[[:space:]]' '\n' | sort | uniq -c | sort -r"
alias k.img='k.imgn'
alias k.img-ns='kubectl get pods -o=jsonpath='"'"'{range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{end}'"'"' --namespace ' # +namespace
alias k.img-pod='kubectl get pods --all-namespaces -o=jsonpath='"'"'{range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{end}'"'"' | sort'
alias k.img-pod='kubectl get pods -o=jsonpath='"'"'{range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{end}'"'"' | sort'
alias k.img-pod-all='kubectl get pods --all-namespaces -o=jsonpath='"'"'{range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{end}'"'"' | sort'

## Labels
alias k.labels-team-uniq="kubectl get pods -A -o jsonpath='{..labels.team}' | tr -s '[[:space:]]' '\n' | sort | uniq"
Expand Down

0 comments on commit e7dedb2

Please sign in to comment.