mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
Update export k8s log script (#8832)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
parent
9e194888ce
commit
85f9fb4a40
@ -1,11 +1,19 @@
|
||||
array=($(kubectl get pod|grep chaos-milvus|awk '{print $1}')) # change chaos-milvus to your own pod name prefix
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
ns_name=$1
|
||||
prefix_name=$2
|
||||
array=($(kubectl get pod -n ${ns_name}|grep ${prefix_name}|awk '{print $1}'))
|
||||
echo ${array[@]}
|
||||
log_dir="k8s_logs"
|
||||
mkdir $log_dir
|
||||
if [ ! -d $log_dir ];
|
||||
then
|
||||
mkdir $log_dir
|
||||
fi
|
||||
echo "export logs start"
|
||||
for pod in ${array[*]}
|
||||
do
|
||||
echo "export logs for pod $pod "
|
||||
kubectl logs $pod > ./$log_dir/$pod.log
|
||||
kubectl logs $pod -n ${ns_name} > ./$log_dir/$pod.log
|
||||
done
|
||||
echo "export logs done"
|
||||
|
Loading…
Reference in New Issue
Block a user