I would like to know how to deploy a ETCD cluster for Kubernetes.
It seems like there are two different documentation and I don't know which one must be considered or the impact of each of them.
From the Kubernetes documentation for a multi-cluster etcd, it suggested to start it like this
etcd --listen-client-urls=http://$IP1:2379,http://$IP2:2379,http://$IP3:2379,http://$IP4:2379,http://$IP5:2379 --advertise-client-urls=http://$IP1:2379,http://$IP2:2379,http://$IP3:2379,http://$IP4:2379,http://$IP5:2379
Here the --listen-client-urls--
has the list of all the ETCD endpoints and same thing for --advertise-client-urls
and from the Kubernetes documentation that command is ran only once.
From the ETCD documentation that command must be run in each of the node
$ etcd --name infra0 --initial-advertise-peer-urls https://10.0.1.10:2380 \
--listen-peer-urls https://10.0.1.10:2380 \
--listen-client-urls https://10.0.1.10:2379,https://127.0.0.1:2379 \
--advertise-client-urls https://10.0.1.10:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster infra0=https://10.0.1.10:2380,infra1=https://10.0.1.11:2380,infra2=https://10.0.1.12:2380 \
--initial-cluster-state new \
--client-cert-auth --trusted-ca-file=/path/to/ca-client.crt \
--cert-file=/path/to/infra0-client.crt --key-file=/path/to/infra0-client.key \
--peer-client-cert-auth --peer-trusted-ca-file=ca-peer.crt \
--peer-cert-file=/path/to/infra0-peer.crt --peer-key-file=/path/to/infra0-peer.key
and we can notice that the --listen-client-urls--
contain only the IP address of the current node and the other parameters are not present in the Kubernetes documentation.
Why are they so different?
Can you help me to understand?
Which one is the good one? When does each of them must be used?