Last active
October 17, 2018 03:11
-
-
Save pyramation/7493684d4998828b33bac40e74ca94ce to your computer and use it in GitHub Desktop.
k8s bash helpers
This file contains 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
#!/bin/bash | |
if [ -z "$2" ] | |
then | |
echo "Usage: $(basename $0) <namespace> <app>" | |
exit 1 | |
fi | |
POD=$(kubectl get pods -n $1 -l app=$2 -o jsonpath="{.items[*].metadata.name}") | |
kubectl logs -n $1 $POD -f |
This file contains 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
#!/bin/bash | |
if [ -z "$2" ] | |
then | |
echo "Usage: $(basename $0) <namespace> <app>" | |
exit 1 | |
fi | |
POD=$(kubectl get pods -n $1 -l app=$2 -o jsonpath="{.items[*].metadata.name}") | |
echo $POD |
This file contains 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
#!/bin/bash | |
if [ -z "$2" ] | |
then | |
echo "Usage: $(basename $0) <namespace> <app>" | |
exit 1 | |
fi | |
POD=$(kubectl get pods -n $1 -l app=$2 -o jsonpath="{.items[*].metadata.name}") | |
kubectl -n $1 exec -it $POD /bin/sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment