Initialize configurations
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
function klogs() {
|
||||
local ctx="$1"
|
||||
local namespace="$2"
|
||||
local label="$3"
|
||||
|
||||
if [[ "$ctx" == "" || "$namespace" == "" || "$label" == "" ]]; then
|
||||
echo "Usage: klogs context namespace label"
|
||||
echo "\nContexts:"
|
||||
kubectl config get-contexts -o name | sed 's/^/\t/g'
|
||||
|
||||
echo "Label examples:"
|
||||
echo "\tapp.kubernetes.io/name=..."
|
||||
echo "\teks.amazonaws.com/component=..."
|
||||
return 1
|
||||
fi
|
||||
|
||||
kubectl --context "$context" logs -f -n "$namespace" -l "$label"
|
||||
}
|
||||
Reference in New Issue
Block a user