每次使用etcdctl,都要长长的一大串,太麻烦了,直接把变量写入文件中,就方便很多了
vi ~/.bashrc
行尾添加
export ETCDCTL_ENDPOINTS=https://127.0.0.1:2379
export ETCDCTL_CACERT=/etc/kubernetes/pki/etcd/ca.crtexport ETCDCTL_CERT=/etc/kubernetes/pki/etcd/healthcheck-client.crtexport ETCDCTL_KEY=/etc/kubernetes/pki/etcd/healthcheck-client.key然后保存退出
source ~/.bashrc
然后就可以欢快的etcdctl get /flannel/network/config
参考: