Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing critical step for restore #788

Open
porrascarlos802018 opened this issue Mar 14, 2024 · 0 comments
Open

missing critical step for restore #788

porrascarlos802018 opened this issue Mar 14, 2024 · 0 comments

Comments

@porrascarlos802018
Copy link

step to correctly update the etcd is not provided in this document

URL: https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/

if you execute
ETCDCTL_API=3 etcdctl snapshot restore /pathto/snapshot.db --data-dir /var/lib/etcd-from-backup --endpoints=https://127.0.0.1:2379 --cacert=/pathto/ca.crt --cert=/pathto/server.crt --key=/pathto/keyfile.key

the data restored and used by etcd needs to be redirected to the new path , what steps needs to be done and which commands to do it?

to restore

  1. stop the kube-api server service :
    service kube-apiserver stop

  2. ETCDCTL_API:3 etcdctl snapshot restore snapshot.db --data-dir /var/lib/etcd-from-backup
    #the path is the path of the backup file. in this case snapshot .db file.
    #a new data directory is created. in this case /var/lib/etcd-from-backup
    etcd is configured then to use the new path
    --data-dir=/var/lib/etcd-from-backup

*****MISSING update the /etc/kubernetes/manifests/etcd.yaml , change hostPath for the volume etcd-data from its old value to the new one ****

reload the service
systemctl daemon-reload
service etcd restart

start the api service
kube-apiserver start

with kubeadm you always have to specify --endpoints --cacert --cert --key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant