SMP:
Hej hej!
I am trying to pass the backup and restore practice test (https://kodekloud.com/topic/practice-test-backup-and-restore-methods-2/) for etcd. Unfortunately etcd does not come up again and everything goes down or is not reachable anymore as soon as i change the etcd.yaml to point to the new mountPath. I tried the “solution” from the solution tab, but i get the same problems. I am not sure if i do a mistake but what i do is basically:
# make things easier
export ETCDCTL_API=3
alias etcdctl='etcdctl --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key'
# snapshot
etcdctl snapshot save /opt/snapshot-pre-boot.db
# restore
etcdctl snapshot restore --data-dir /var/lib/etcd-from-backup /opt/snapshot-pre-boot.db
# edit manifest
vim /etc/kubernetes/manifests/etcd.yaml
# Change mount path /var/lib/etcd to /var/lib/etcd-from-backup
---
volumeMounts:
- mountPath: /var/lib/etcd-from-backup
name: etcd-data
---
# Watch until etcd is backup
watch "docker ps | grep etcd"
# Check everything
k get all -A
In my last try i got the following output when using k get all -A
- but i get this error:
root@controlplane /etc/kubernetes/manifests ➜ k get all -A
The connection to the server controlplane:6443 was refused - did you specify the right host or port?
The connection to the server controlplane:6443 was refused - did you specify the right host or port?
The connection to the server controlplane:6443 was refused - did you specify the right host or port?
A second question would be about the exam environment. Is etcd running in Docker environment similiar to kodekloud or is it an installation on the host itself, so i need to use systemd for start/stop like shown in the CKA course video about etcd backups?
edit: i am checking out the solutions video too right now