saranga baruah:
Hi All - have couple of basic queries on the etcd backup restore process.
- Is the etcd back up restore process using data directory method always supposed to be done from the master/controlplane node?
- In case of etcd backup restore process in worker node, do we need to first install etcdtl client in worker node. Also do we need to update the hostpath in the etcd manifest file in worker node or master node?
- How do verify if the backup restore process is successful or not
Alistair Mackay:
Hi,
etcd backup is the topic that gets everyone!
- It can be done from anywhere that
etcdctl
client is installed. If this is not the same host as where the etcd master node is running (usually master/controlplane), then you need to use --endpoints
argument to point etcdctl
to the correct host.
- For the purposes of the course labs, killer and the exam, you will never need to install
etcdctl
- it will be somewhere. There should only be one etcd node, and it is that node’s manifest you will update.
- If I recall correctly, the lab will ask you to delete a pod after taking the backup. If the restore works, the deleted pod will come back.
Hope that helps.
Alistair Mackay:
Should an exam question ever require you to install anything - if that thing is not in the sites you are permitted to open in your browser, they will provide the link in the question.
saranga baruah:
Great explanation @Alistair Mackay, clears most of my queries.
Regarding endpoints in #1, how do we fetch the host endpoints?
Alistair Mackay:
Endpoint is an https URL with etcd client port, for the machine (node) on which etcd is running e.g.
<https://controlplane:2379>
or use IP address if hostname does not resolve.
Alistair Mackay:
If etcd and etcdctl are on the same machine, then you can omit --endpoints
as it should default to <https://127.0.0.1:2379>
i.e. locahost
saranga baruah:
Ok @Alistair Mackay, so if we see in the etcd pod something like this:
“–listen-client-urls=https://127.0.0.1:2379,https://10.41.3.6:2379” (here 10.41.3.6 is pod internal ip)
that means can we use either of them as endpoint during etcd backup?
Alistair Mackay:
etcdctl is an application running outside of the cluster, so it cannot see any pod internal IP.
You have to use node hostname or IP address if etcdctl is not on the same host as that hosting the etcd pod.
Also see this: https://kodekloud.slack.com/archives/CHMV3P9NV/p1651490144475009?thread_ts=1651462564.857409&cid=CHMV3P9NV