From e3c7966b335730464af1ae1c963aea70aec8cc16 Mon Sep 17 00:00:00 2001 From: Matheus Albino Brunhara Date: Tue, 26 Sep 2023 08:36:08 -0300 Subject: [PATCH] Add klogs.sh script --- my-scripts/shell/klogs.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 my-scripts/shell/klogs.sh diff --git a/my-scripts/shell/klogs.sh b/my-scripts/shell/klogs.sh new file mode 100755 index 0000000..3694f46 --- /dev/null +++ b/my-scripts/shell/klogs.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Check if an argument was provided +if [ $# -eq 0 ]; then + echo "Usage: ./script.sh " + exit 1 +fi + +# Get the deployment name from the first argument +deployment_name=$1 + +# Run the kubectl command +kubectl logs -l app.kubernetes.io/instance="$deployment_name"