I am new to k8s, and i was trying to build a etcd cluster. Now i have completed all the steps and got the desired output.
ubuntu@controller0:/etc/systemd/system$ sudo ETCDCTL_API=3 etcdctl member list --endpoints=https://10.240.0.10:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/kubernetes.pem --key=/etc/etcd/kubernetes-key.pem
3a57933972cb5131, started, controller2, https://10.240.0.12:2380, https://10.240.0.12:2379, false
f98dc20bce6225a0, started, controller0, https://10.240.0.10:2380, https://10.240.0.10:2379, false
ffed16798470cab5, started, controller1, https://10.240.0.11:2380, https://10.240.0.11:2379, false
But what is a bit confusing to me is the false
for all 3 of the etcd hosts. Can someone help me to explain if that means none of them is currently master? and when if this output is correct
etcdctl member list --help
NAME:
member list - Lists all members in the cluster
USAGE:
etcdctl member list [flags]
DESCRIPTION:
When --write-out is set to simple, this command prints out comma-separated member lists for each endpoint.
The items in the lists are ID, Status, Name, Peer Addrs, Client Addrs, Is Learner.
As you can see from above the last column is for Is Learner
which is false for all of your nodes. ETCD version 3.4 introduces a new node state “Learner”, which joins the cluster as a non-voting member until it catches up to leader’s logs. This means the learner still receives all updates from leader, while it does not count towards the quorum, which is used by the leader to evaluate peer activeness. The learner only serves as a standby node until promoted. This relaxed requirements for quorum provides the better availability during membership reconfiguration and operational safety.
So your ETCD cluster is in good state. To verify leader is there or not use below command
sudo ETCDCTL_API=3 etcdctl endpoint status --write-out=table --endpoints=https://10.240.0.10:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/kubernetes.pem --key=/etc/etcd/kubernetes-key.pem
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| https://172.16.2.3:2379 | f15c8d27ccf66395 | 3.4.3 | 2.2 MB | false | false | 6 | 41219 | 41219 | |
| https://172.16.2.6:2379 | be8c6e0b5f5f6157 | 3.4.3 | 2.2 MB | true | false | 6 | 41219 | 41219 | |
| https://172.16.2.7:2379 | 7e7a0308e6c2067f | 3.4.3 | 2.2 MB | false | false | 6 | 41219 | 41219 | |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+