未验证 提交 2ad441e3 编写于 作者: Z zhuwenxing 提交者: GitHub

Add script to get etcd info (#22588)

Signed-off-by: Nzhuwenxing <wenxing.zhu@zilliz.com>
上级 f3e2d4a3
#!/bin/bash
instance_name=$1
# Define the etcdctl command with endpoints option
etcdctl_cmd="etcdctl endpoint status -w table --endpoints"
# Get the ip of all the etcd pods with the specified labels
etcd_pods=$(kubectl get pods -l app.kubernetes.io/name=etcd,app.kubernetes.io/instance=${instance_name} -o jsonpath='{.items[*].status.podIP}')
# Loop through the list of etcd pods and get their status
endpoints=""
for pod in $etcd_pods
do
endpoints+="$pod:2379,"
done
$etcdctl_cmd ${endpoints::-1}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册