大家好,
也许是一个非常愚蠢的问题,但我在集群节点之间有一个带有 SSL 的 CoreOS 集群。我已经在我的云配置中设置了舰队和 etcd。
舰队ctl 工作得很好。我不必提供任何证书,但是当我使用 etcdctl 时,我被迫提供这样的证书路径:
etcdctl --ca-file /home/core/etcd/certificates/ca.pem --cert-file /home/core/etcd/certificates/coreos.pem --key-file /home/core/etcd/certificates/coreos-key.pem --endpoint "https://10.129.1.226:2379" get /test/key
有没有一种方法可以配置 etcd2,使得 etcdctl 每次都不需要证书路径,例如:
etcdctl get /test/key
我的云配置的一部分:
write_files:
# tell etcd2 and fleet where our certificates are going to live:
- path: /run/systemd/system/etcd2.service.d/30-certificates.conf
permissions: 0644
content: |
[Service]
# client environment variables
Environment=ETCD_CA_FILE=/home/core/etcd/certificates/ca.pem
Environment=ETCD_CERT_FILE=/home/core/etcd/certificates/coreos.pem
Environment=ETCD_KEY_FILE=/home/core/etcd/certificates/coreos-key.pem
# peer environment variables
Environment=ETCD_PEER_CA_FILE=/home/core/etcd/certificates/ca.pem
Environment=ETCD_PEER_CERT_FILE=/home/core/etcd/certificates/coreos.pem
Environment=ETCD_PEER_KEY_FILE=/home/core/etcd/certificates/coreos-key.pem