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

Use namespace as subject instead of etcd pod for k8s etcd backup and restore #742

Merged
merged 6 commits into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review comments
  • Loading branch information
viveksinghggits committed Aug 27, 2020
commit 5a8a1d34b4d79ef0f2a5db3f4f91e5d7dcc02f4a
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ actions:
- -c
- |
BACKUP_LOCATION=etcd_backups/{{ .Object.metadata.name }}/{{ toDate "2006-01-02T15:04:05.999999999Z07:00" .Time | date "2006-01-02T15:04:05Z07:00" }}/etcd-backup.db.gz
kubectl cp {{ .Object.metadata.name }}/"{{ .Phases.takeSnapshot.Output.etcdPod }}":/tmp/etcd-backup.db /tmp/etcd-backup.db
kubectl cp {{ .Object.metadata.name }}/{{ .Phases.takeSnapshot.Output.etcdPod }}:/tmp/etcd-backup.db /tmp/etcd-backup.db
gzip /tmp/etcd-backup.db
kando location push --profile '{{ toJson .Profile }}' /tmp/etcd-backup.db.gz --path $BACKUP_LOCATION
kando output backupLocation $BACKUP_LOCATION
Expand All @@ -56,7 +56,7 @@ actions:
- sh
- -c
- |
kubectl exec -it -n {{ .Object.metadata.name }} "{{ .Phases.takeSnapshot.Output.etcdPod }}" -c etcd -- sh -c "rm -rf /tmp/etcd-backup.db"
kubectl exec -it -n {{ .Object.metadata.name }} {{ .Phases.takeSnapshot.Output.etcdPod }} -c etcd -- sh -c "rm -rf /tmp/etcd-backup.db"

delete:
type: Namespace
Expand Down
4 changes: 1 addition & 3 deletions examples/etcd/etcd-in-cluster/ocp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ No resources found.
## Restore ETCD cluster

To restore the ETCD cluster we can follow the [documentation](https://docs.openshift.com/container-platform/4.5/backup_and_restore/disaster_recovery/scenario-2-restoring-cluster-state.html) that is provided by the OpenShift team.
But we will have to make some modification in the restore script (`cluster-restore.sh`) because default
restore script expects the static pods manifest as well, and in our case we didn't backup the static pod manifests. We have made respective changes
in the script that is provided by OpenShift, that can be found in this repo.
The restore script (`cluster-restore.sh`) mentioned above requires modification as it expects the static pods manifests which are not backed up in our case. The modified restore script can be found in this repo.

You can follow the steps that are mentioned below along with the documentation that is mentioned above, most of the steps that are mentioned here are either directly taken from the documentation or are modified version of it. Among all the running leader nodes choose one node to be the restore node, make sure you have SSH connectivity to all of the leader nodes including the one that you have chosen to be restore node.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can follow the steps that are mentioned below along with the documentation that is mentioned above, most of the steps that are mentioned here are either directly taken from the documentation or are modified version of it. Among all the running leader nodes choose one node to be the restore node, make sure you have SSH connectivity to all of the leader nodes including the one that you have chosen to be restore node.
Additional steps to be followed are mentioned below. Among all the running leader nodes, choose one node to be the restore node. Ensure there is SSH connectivity to all the leader nodes including the one the chosen restore node.

Copy link
Contributor Author

@viveksinghggits viveksinghggits Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so I wanted to clearly specify that the steps that are mentioned below are not our steps (steps that we have figured) but they have just been taken from the above documentation. And I think that is an important distinction to make. WDYT

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tdmanv
Can you please have a look into above comment. And suggest what should be done.


Expand Down