Vitor Jr.:
I like to change everything so I have less chance to do something wrong
Vitor Jr.:
But feel free to try it
Hailu Meng:
Got it. One more argument, if I put data-dir in the restore command as the same original data dir /var/lib/etcd, does it mean I don’t need to change the static pod yaml later?
Vitor Jr.:
Yes, but I would probably do some more steps, like:
• copy of /var/lib/etcd
to some backup place
• empty /var/lib/etcd
dir
• mv /etc/kubernetes/manifests/etcd.yaml
to some other place
• do the restore operation
• mv etcd.yaml
back again
Hailu Meng:
I tried this way @Vitor Jr. . Pretty stable so far, no need to modify the yaml. Just move it to somewhere else and move back after the restore.
Hailu Meng:
One thing I noticed when I tried modifying yaml way, etcd container sometime didn’t get back. I restarted containerd in the simulator lab, it didn’t help. Move yaml files out and back. It still didn’t work. Then I restarted kubelet, etcd finally showed up. So I guess if we ever see etcd not coming back after modifying yaml file, restarting kubelet will help. Maybe this could help someone.
Vitor Jr.:
Nice tip!
Hailu Meng:
And one more thing I think I want to point out: based on the testing results I got, it’s much SAFER to move the yaml file out before you do the restore no matter you will change the data dir or not. Etcd comes right back after you move yaml file back and I don’t have to restart the kubelet. I think directly modifying yaml under manifest directory really could upset kubelet. Just to remember moving the files before the restore to save you hassle. @Vitor Jr. , maybe we should tweak our lab guide on this. Just a suggestion.