k8s之etcd查询和备份
获取etcd证书密钥路径kubectl describe pods -n kube-system etcd-calico115Command:etcd--cert-file=/etc/kubernetes/pki/etcd/server.crt 对应 --cert=--key-file=/etc/kubernetes/pki/etcd/server.key 对应--key=--trusted-ca
·
kubectl describe pods -n kube-system etcd-calico115
Command:
etcd
--cert-file=/etc/kubernetes/pki/etcd/server.crt 对应 --cert=
--key-file=/etc/kubernetes/pki/etcd/server.key 对应 --key=
--trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt 对应 --cacert
查看状态
kubectl exec -n kube-system etcd-calico115 -- etcdctl --endpoints="https://127.0.0.1:2379" --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key member list -w table
alias etcdctl='kubectl exec -n kube-system etcd-calico115 -- etcdctl --endpoints="https://127.0.0.1:2379" \
--cacert=/etc/kubernetes/pki/etcd/ca.crt \
--cert=/etc/kubernetes/pki/etcd/server.crt \
--key=/etc/kubernetes/pki/etcd/server.key'
etcdctl get / --prefix=true --keys-only
etcdctl get /registry/pods/default/ --prefix=true --keys-only
etcdctl snapshot save /tmp/`hostname`_date`date +%Y_%m_%d-%H-%M`.db
更多推荐
已为社区贡献82条内容
所有评论(0)