k8s配置etcdctl命令
docker cp `docker ps -a | awk '/k8s_etcd/{print $1}'`:/usr/local/bin/etcdctl /usr/local/bin/etcdctl
查看etcd状态脚本
cat /sbin/etcdstatus ETCD_CERET_DIR=/etc/kubernetes/pki/etcd/ ETCD_CA_FILE=ca.crt ETCD_KEY_FILE=healthcheck-client.key ETCD_CERT_FILE=healthcheck-client.crt ETCD_EP=https://10.0.2.121:2379,https://10.0.2.122:2379,https://10.0.2.123:2379 etcd_v2="etcdctl --cert-file ${ETCD_CERET_DIR}/${ETCD_CERT_FILE} \ --key-file ${ETCD_CERET_DIR}/${ETCD_KEY_FILE} \ --ca-file ${ETCD_CERET_DIR}/${ETCD_CA_FILE} \ --endpoints $ETCD_EP" etcd_v3="etcdctl \ --cert ${ETCD_CERET_DIR}/${ETCD_CERT_FILE} \ --key ${ETCD_CERET_DIR}/${ETCD_KEY_FILE} \ --cacert ${ETCD_CERET_DIR}/${ETCD_CA_FILE} \ --endpoints $ETCD_EP" export ETCDCTL_API=3 comm="$etcd_v3 endpoint status --write-out=table" echo "`$comm`"
加权限 777
chmod 777 /sbin/etcdstatus