-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Migrate to using custom resource to store etcd snapshot metadata #8064
Conversation
3eef133
to
4df89b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing this up Brad. I have two (stupid?) questions:
1 - Will this impact how rke2 is doing snapshots too?
2 - IIRC, snapshots are stored in /var/lib/rancher/k3s/server/db/snapshots
, right? So, what the configmap stores is information about the snapshots stored in the filesystem, right?
Yes, this code manages snapshots for both products.
Yes, and the snapshots stored in s3. |
09995ae
to
4df89b4
Compare
@Oats87 I know we talked this over in design, but it would be good to get sign-off from the v2prov side to make sure y'all are in agreement with whatever we decide to do here |
I have a couple changes to make based on what was discussed in the call. This includes:
|
ee69be6
to
b89adc9
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #8064 +/- ##
==========================================
+ Coverage 47.05% 50.66% +3.60%
==========================================
Files 144 147 +3
Lines 14964 15611 +647
==========================================
+ Hits 7042 7909 +867
+ Misses 6809 6453 -356
- Partials 1113 1249 +136
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
cc @jakefhyde @Oats87 for any RM-related review |
Moving to draft, this is still work in progress |
886025d
to
2eb5014
Compare
84eddb1
to
3ceae0c
Compare
6bc6bc3
to
4854dbf
Compare
Signed-off-by: Brad Davidson <[email protected]>
Signed-off-by: Brad Davidson <[email protected]>
Also adds a hack go script to print the embedded CRDs, for developer use. Signed-off-by: Brad Davidson <[email protected]>
Signed-off-by: Brad Davidson <[email protected]>
…estEntityTooLarge Signed-off-by: Brad Davidson <[email protected]>
Consistently refer to object keys as such, simplify error handling. Signed-off-by: Brad Davidson <[email protected]>
Attempt to use timestamp from creation or filename instead of file/object modification times Signed-off-by: Brad Davidson <[email protected]>
Also, don't list ONLY s3 snapshots if S3 is enabled. Signed-off-by: Brad Davidson <[email protected]>
Write the extra metadata both locally and to S3. These files are placed such that they will not be used by older versions of K3s that do not make use of them. Signed-off-by: Brad Davidson <[email protected]>
Fixes snapshot list coming out in non-deterministic order Signed-off-by: Brad Davidson <[email protected]>
Signed-off-by: Brad Davidson <[email protected]>
Reconcile snapshot CRs instead of ConfigMap; manage ConfigMap downstream from CR list Signed-off-by: Brad Davidson <[email protected]>
This required pulling the token hash stuff out of the cluster package, into util. Signed-off-by: Brad Davidson <[email protected]>
Snapshot delete/prune tests were only working because the delete command would report success even when deleting a snapshot that didn't exist, and the test regex was finding the snapshot name multiple times in the list output and deleting it twice. Snapshot restore tests seem to have expected the deployment to be rolled out immediately, which is not a reasonable expectation. Signed-off-by: Brad Davidson <[email protected]>
4854dbf
to
174ff79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provisional approval pending CI.
S390x is having issues and we do not have an ETA for restoration; all other tests are green. merging |
Proposed Changes
Add ADR and implementation for etcd snapshot CRD migration.
Types of Changes
ADR, bugfix, reimplementation
Verification
Run full snapshot create / delete / prune tests; confirm that all function normally and snapshot CRs, configmaps, and CLI output stay in sync
Testing
n/a
Linked Issues
User-Facing Change
Further Comments