Created
December 13, 2016 13:59
-
-
Save leopoldodonnell/7ebe95f550b046a93a62b808693a2a2a to your computer and use it in GitHub Desktop.
Kubectl tricks etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display all pods including IP info | |
kubectl get pods --all-namespaces --show-all -o wide | |
# Display all of the running containers | |
kubectl get pods -o jsonpath={.items[*].spec.containers[*].image} --all-namespaces --show-all |tr ' ' '\n' |sort -u | |
# Get the nodeport for a service - find a jsonpath way | |
servicename=`kubectl get svc some-service` | |
kubectl describe service $servicename |awk '$1 == "NodePort:" {sub(/\\/TCP/, "", $NF); print $NF}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment