インフラ系SEの技術メモ

雑なエンジニアが低信頼性のメモを書いています。参考程度にとどめてください。

etcdへアクセスするためのetcdctlコマンドの試行錯誤

はじめに

色々試しましたが結局表示されず。
下記の失敗を参考にください。

環境情報
  • DockerDesktop
  • etcdctl 3.3.10

コマンド実行結果

# etcdctl ls
Error:  client: etcd cluster is unavailable or misconfigured; error #0: dial tcp 127.0.0.1:4001: connect: connection refused
; error #1: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02"

error #0: dial tcp 127.0.0.1:4001: connect: connection refused
error #1: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02"

エンドポイントを指定

# etcdctl --endpoints https://192.168.65.3:2379 ls
Error:  client: etcd cluster is unavailable or misconfigured; error #0: x509: failed to load system roots and no roots provided

error #0: x509: failed to load system roots and no roots provided

鍵を指定

# etcdctl --endpoints https://192.168.65.3:2379 --key-file /run/config/pki/etcd/ca.key ls
KeyFile and CertFile must both be present[key: /run/config/pki/etcd/ca.key, cert: ]

証明書を指定

# etcdctl --endpoints https://192.168.65.3:2379 --key-file /run/config/pki/etcd/ca.key --cert-file /run/config/pki/etcd/ca.crt ls
Error:  client: etcd cluster is unavailable or misconfigured; error #0: x509: failed to load system roots and no roots provided

error #0: x509: failed to load system roots and no roots provided

認証局証明書を指定

# etcdctl --endpoints https://192.168.65.3:2379 --key-file /run/config/pki/etcd/ca.key --cert-file /run/config/pki/etcd/ca.crt --ca-file /run/c
onfig/pki/etcd/ca.crt ls
Error:  client: etcd cluster is unavailable or misconfigured; error #0: x509: certificate is valid for 127.0.0.1, not 192.168.65.3

error #0: x509: certificate is valid for 127.0.0.1, not 192.168.65.3

終わりに

結局接続できませんでした...何が足りないんだろ...上記失敗が参考になれば幸いです。