-
Notifications
You must be signed in to change notification settings - Fork 25
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
Backup implementation: controller, plugins, collection, webhooks #841
base: main
Are you sure you want to change the base?
Conversation
80beb93
to
9694287
Compare
56f0846
to
dd516c2
Compare
d8b1204
to
e581f96
Compare
dca5c63
to
d95cd1c
Compare
The logic is valid but I'm still struggling with the mutation, so in terms of the restoration — it works only partially meaning that precisely two restores are required and both will be |
Ok, I've figured out how to mitigate the issue with the The patch is as follows:
|
* rename Backup to ManagementBackup * removed Oneshot parameter from the Spec * reconcile scheduled backups (collect statuses, create schedules, etc.) * reconcile backups (collect statuses, create velero backups) * collect the required velero backup spec for the whole backup * label Credential references (clusterIdentities) in order include them in backup * backup validation webhook * backup controller watches velero resources * amend backup controller logic to better handle scheduled and non-scheduled backups * set velero maintained plugins settings * add custom plugins set via mgmt spec * reconcile all the velero plugins either during the installation or depending on existing BSL objects exist in a cluster * rename k0smotron related provider labels to the correct ones from the k0sproject
d95cd1c
to
fb31e55
Compare
return fmt.Errorf("failed to create uncached client: %w", err) | ||
} | ||
|
||
if err := r.config.InstallVeleroCRDs(uncachedCl); err != nil { |
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.
we should install velero as part of the hmc chart as a dependency (similar to cert-manager)
} | ||
} | ||
|
||
veleroSchedule := &velerov1api.Schedule{ |
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 we need to control execution ourselves (discussed seperately)
q.Add(getManagementNameIfEnabled(ctx)) | ||
}, | ||
}). | ||
Watches(&hmcv1alpha1.ClusterDeployment{}, handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, _ client.Object) []ctrl.Request { |
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.
we won't need all of the watchers in that case
* install velero via flux rather than code * TODO: code removal due to the chart installation * adjusted roles for the velero chart * removed unnecessary controller values * fix bug in providertemplates ctrl when ownerreferences are being updated but requeue is not set * TODO: actually remove the code * TODO: rework controller to ticker but watch the mgmt events and manage schedule instead of velero schedule
46cb367
to
752d860
Compare
(collect statuses, create schedules, etc.)
(collect statuses, create velero backups)
spec for the whole backup
in order to include them in backup
to better handle scheduled and
non-scheduled backups
during the installation or depending
on existing BSL objects exist in a cluster
to the correct ones from the k0sproject
-- TEMPORARY NOT VALID --
NOTE: Because of the changes introduced in the #699 (mutation) it is now impossible to properly restore the full management on an empty
kind
installation, the process of restoration is as follows:kind
installationclustersummaries
sveltos CRD (see HMC Installation Fails on Provisioned Cluster Due to Missing Sveltos Resources and CRDs #847)*templates
velero restore
(e.g.velero restore create <name> --existing-resource-policy update --from-backup <backup-name>
)Completed
state (e.g. withvelero restore get
)hmc-controller-manager
and thecapi-controller-manager
(probably the latter is the result of a bug in the former)To properly test the feature:
k0rdent
instance with this PRmanagement
, set.spec.backup
to the something like{enabled: true; schedule: "@every 5m"}
backupstoragelocation
forvelero
, e.g.k0rdent
instance (imitate a disaster)#814