etcdadm init с версией 3.4.7, сбой команды с неизвестным флагом - PullRequest
0 голосов
/ 10 апреля 2020

Я использую команду etcdadm для создания кластера etcd, init завершается неудачно с флагом --version unkown.

Как создать кластер etcd с последней версией etcd?

# ./etcdadm --version "3.4.7" init
INFO[0000] [install] extracting etcd archive /var/cache/etcdadm/etcd/v3.4.7/etcd-v3.4.7-linux-amd64.tar.gz to /tmp/etcd809914410
INFO[0000] [install] verifying etcd 3.4.7 is installed in /opt/bin/
FATA[0000] [install] Error: command "/opt/bin/etcdctl" failed: "Error: unknown flag: --version\n\nError: unknown flag: --version\n"

1 Ответ

0 голосов
/ 20 апреля 2020

для настройки версии 3.4.7, нам нужно установить переменную окружения ETCDCTL_API.

скомпилировано так:

git clone https://github.com/kubernetes-sigs/etcdadm.git
cd etcdadm/
docker run --rm -it --name golang -v $PWD:/v golang
cd /v
make
ls

Возможность создать базу данных следующим образом:

# ETCDCTL_API=3 ./etcdadm --version "3.4.7" init
INFO[0000] [install] extracting etcd archive /var/cache/etcdadm/etcd/v3.4.7/etcd-v3.4.7-linux-amd64.tar.gz to /tmp/etcd129983779
INFO[0000] [install] verifying etcd 3.4.7 is installed in /opt/bin/
INFO[0000] [certificates] creating PKI assets
INFO[0000] creating a self signed etcd CA certificate and key files
[certificates] Generated ca certificate and key.
INFO[0000] creating a new server certificate and key files for etcd
[certificates] Generated server certificate and key.
[certificates] server serving cert is signed for DNS names [node01] and IPs [x.x.x.x  127.0.0.1]
INFO[0000] creating a new certificate and key files for etcd peering
[certificates] Generated peer certificate and key.
[certificates] peer serving cert is signed for DNS names [node01] and IPs [x.x.x.x ]
INFO[0001] creating a new client certificate for the etcdctl
[certificates] Generated etcdctl-etcd-client certificate and key.
INFO[0001] creating a new client certificate for the apiserver calling etcd
[certificates] Generated apiserver-etcd-client certificate and key.
[certificates] valid certificates and keys now exist in "/etc/etcd/pki"
INFO[0002] [health] Checking local etcd endpoint health
INFO[0002] [health] Local etcd endpoint is healthy
...