-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement jsctl cluster backup
command
#64
Conversation
629b1a9
to
0e41c6e
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 Charlie, some great work on this again 👏🏼
I've left a couple comments most notably
- I think this command too should go in experimental section (as again it will most likely be used in production cases)
- I think we should back up cert-manager alpha/beta resources
- (unlike what we discussed before) I think we should always just not back up ingress certs, at least I cannot see why it would ever work backing them up
I've not tried the backup yet, but will do when the alpha/beta backup is added if you agree with doing that
a3cf19b
to
ebce42a
Compare
0e41c6e
to
28f1816
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.
I think this command too should go in experimental section
Addressed in 28f1816
I've addressed the other comments, I'm going to have a think about how we manage multiple API versions now. |
As discussed privately, afacf30 I hope addressed the immediate concern for unsupported cert-manager API versions. |
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 making all the changes!
I've not ran all the commands yet, but took a look at the CRD version check and I think it's close 👍🏼
48d90f7
to
758051f
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.
I've ran the command now and it seems to largely work as expected, a couple more things that might need fixing before we can merge:
- none of the flags seem to work
- if redirected to file, it gets prefixed with issuer GVK string so is not a valid yaml that could be applied
7419e67
to
63704d2
Compare
Oops, in e0bd753 I use the options in the back up function. I have also rebased this to fix the issue with stdout etc not being passed down correctly.
e0bd753 also addresses this. |
e0bd753
to
410b748
Compare
This command will be used prior to the install of a JS by operators to backup cluster state. Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
410b748
to
0b523ea
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 again for working on this Charlie, I think the command looks great now.
I've ran a couple examples and most things look good.
I noticed that --format=json
flag is not working. Do you think it'd be easy to get that fixed? It would be nice to have this flag as that way we can guide users to use jq
(which I find to be a better tool than yq
) when re-applying the necessary resources from backup.
Otherwise we could remove the flag, happy to merge this either way.
Hmm, that's a good spot 😬 I've updated the command so it works like this now:
Lmk if you have any thoughts on 4bb3468 which adds this change. I thought it made sense to wrap it in a k8s list so that it can be kubectl applied. |
Why did we need to make this into a list? Not thought about this in depth, but it seems like it'd be nice if both yaml and json would output the same structure. At the moment the |
I think that is required to allow it to be piped to
hmm, I can update that to support this unversioned JSON list. |
yeah I've not thought about this in depth, but the output file should be usable to by the command that converts issuers. |
I have made it possible to use a JSON backup file in 6344414 |
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 a lot for working on this Charlie
I've tested the --experimental-issuers-backup-file flag with JSON output from this command and saw that all works as expected
/lgtm
Thanks Irbe! |
This implements a command to generate a cluster back up from the state in the K8S API.
Example output can be found in internal/kubernetes/backup/fixtures/backup.yaml, status and createdTime values come from the k8s yaml generation. These can be removed with a further round of redaction if we'd like.