-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remote restore support for Medusa (#454)
* Add MedusaTask API with support for purge, sync and restore prep, and implement remote restore. The PrepareRestore grpc call will have Medusa compute the mapping between the backup and restore clusters, and store it in the local storage. This will allow the restore init container to know which mapping should be performed, without having Cassandra up. * Upgrade to Medusa 0.13.1
- Loading branch information
1 parent
75308d2
commit 2e6ed83
Showing
79 changed files
with
5,013 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
Copyright 2021. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
"github.com/k8ssandra/k8ssandra-operator/pkg/shared" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// MedusaBackupSpec defines the desired state of MedusaBackup | ||
type MedusaBackupSpec struct { | ||
// The name of the CassandraDatacenter to back up | ||
CassandraDatacenter string `json:"cassandraDatacenter"` | ||
|
||
// The type of the backup: "full" or "differential" | ||
// +kubebuilder:validation:Enum=differential;full; | ||
// +kubebuilder:default:=differential | ||
Type shared.BackupType `json:"backupType,omitempty"` | ||
} | ||
|
||
// MedusaBackupStatus defines the observed state of MedusaBackup | ||
type MedusaBackupStatus struct { | ||
StartTime metav1.Time `json:"startTime,omitempty"` | ||
FinishTime metav1.Time `json:"finishTime,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// MedusaBackup is the Schema for the medusabackups API | ||
type MedusaBackup struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec MedusaBackupSpec `json:"spec,omitempty"` | ||
Status MedusaBackupStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// MedusaBackupList contains a list of MedusaBackup | ||
type MedusaBackupList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []MedusaBackup `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&MedusaBackup{}, &MedusaBackupList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
Copyright 2021. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
"github.com/k8ssandra/k8ssandra-operator/pkg/shared" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// MedusaBackupJobSpec defines the desired state of MedusaBackupJob | ||
type MedusaBackupJobSpec struct { | ||
// The name of the CassandraDatacenter to back up | ||
CassandraDatacenter string `json:"cassandraDatacenter"` | ||
|
||
// The type of the backup: "full" or "differential" | ||
// +kubebuilder:validation:Enum=differential;full; | ||
// +kubebuilder:default:=differential | ||
Type shared.BackupType `json:"backupType,omitempty"` | ||
} | ||
|
||
// MedusaBackupJobStatus defines the observed state of MedusaBackupJob | ||
type MedusaBackupJobStatus struct { | ||
StartTime metav1.Time `json:"startTime,omitempty"` | ||
|
||
FinishTime metav1.Time `json:"finishTime,omitempty"` | ||
|
||
InProgress []string `json:"inProgress,omitempty"` | ||
|
||
Finished []string `json:"finished,omitempty"` | ||
|
||
Failed []string `json:"failed,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// MedusaBackupJob is the Schema for the medusabackupjobs API | ||
type MedusaBackupJob struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec MedusaBackupJobSpec `json:"spec,omitempty"` | ||
Status MedusaBackupJobStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// MedusaBackupJobList contains a list of MedusaBackupJob | ||
type MedusaBackupJobList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []MedusaBackupJob `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&MedusaBackupJob{}, &MedusaBackupJobList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
Copyright 2021. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// MedusaRestoreJobSpec defines the desired state of MedusaRestoreJob | ||
type MedusaRestoreJobSpec struct { | ||
// The name of the CassandraBackup to restore. | ||
Backup string `json:"backup"` | ||
|
||
// Name of the Cassandra datacenter to perform the restore on. | ||
CassandraDatacenter string `json:"cassandraDatacenter"` | ||
} | ||
|
||
// MedusaRestoreJobStatus defines the observed state of MedusaRestoreJob | ||
type MedusaRestoreJobStatus struct { | ||
// A unique key that identifies the restore operation. | ||
RestoreKey string `json:"restoreKey"` | ||
|
||
RestorePrepared bool `json:"restorePrepared,omitempty"` | ||
|
||
StartTime metav1.Time `json:"startTime,omitempty"` | ||
|
||
FinishTime metav1.Time `json:"finishTime,omitempty"` | ||
|
||
DatacenterStopped metav1.Time `json:"datacenterStopped,omitempty"` | ||
|
||
InProgress []string `json:"inProgress,omitempty"` | ||
|
||
Finished []string `json:"finished,omitempty"` | ||
|
||
Failed []string `json:"failed,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// MedusaRestoreJob is the Schema for the medusarestorejobs API | ||
type MedusaRestoreJob struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec MedusaRestoreJobSpec `json:"spec,omitempty"` | ||
Status MedusaRestoreJobStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// MedusaRestoreJobList contains a list of MedusaRestoreJob | ||
type MedusaRestoreJobList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []MedusaRestoreJob `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&MedusaRestoreJob{}, &MedusaRestoreJobList{}) | ||
} |
Oops, something went wrong.