mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
5c6f9c9691
Signed-off-by: Jenny Li <jing.li@zilliz.com>
22 lines
431 B
Bash
Executable File
22 lines
431 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Exit immediately for non zero status
|
|
set -e
|
|
|
|
ns_name=$1
|
|
prefix_name=$2
|
|
log_dir=${3:-"k8s_logs"}
|
|
array=($(kubectl get pod -n ${ns_name}|grep ${prefix_name}|awk '{print $1}'))
|
|
echo ${array[@]}
|
|
if [ ! -d $log_dir ];
|
|
then
|
|
mkdir -p $log_dir
|
|
fi
|
|
echo "export logs start"
|
|
for pod in ${array[*]}
|
|
do
|
|
echo "export logs for pod $pod "
|
|
kubectl logs $pod -n ${ns_name} > ./$log_dir/$pod.log 2>&1
|
|
done
|
|
echo "export logs done"
|