-
Notifications
You must be signed in to change notification settings - Fork 66
feat(23570): Add controller for workspace backup #1530
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
base: main
Are you sure you want to change the base?
Changes from all commits
1480c98
d1a8f94
b5bbebd
307145c
51b3eec
9b0ed96
c282a59
aa1053d
b99674a
9c41684
b0f56b3
4be0f98
c4a958c
2e99b7e
cbc61d8
afacdec
efe0538
3aba677
1e4e3fc
142a502
f083043
6433a76
191bec9
9d2b116
6af5fb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,6 +72,45 @@ type CleanupCronJobConfig struct { | |
| Schedule string `json:"schedule,omitempty"` | ||
| } | ||
|
|
||
| type RegistryConfig struct { | ||
| // A registry where backup images are stored. Images are stored | ||
| // in {path}/${DEVWORKSPACE_NAMESPACE}/${DEVWORKSPACE_NAME}:latest | ||
| // +kubebuilder:validation:Required | ||
| Path string `json:"path,omitempty"` | ||
tolusha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // AuthSecret is the name of a Kubernetes secret of | ||
| // type kubernetes.io/dockerconfigjson. | ||
| // The secret is expected to be in the same namespace the workspace is running in. | ||
| // If secret is not found in the workspace namespace, the operator will look for the secret | ||
| // in the namespace where the operator is running in. | ||
| // as the DevWorkspaceOperatorCongfig. | ||
| // +kubebuilder:validation:Optional | ||
Allda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| AuthSecret string `json:"authSecret,omitempty"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dkwon17
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 to do that, @Allda could we add this line, or something similar in the description (line 86)? and use the regular client in the |
||
| } | ||
|
|
||
| type OrasConfig struct { | ||
| // ExtraArgs are additional arguments passed to the oras CLI | ||
| // +kubebuilder:validation:Optional | ||
| ExtraArgs string `json:"extraArgs,omitempty"` | ||
Allda marked this conversation as resolved.
Show resolved
Hide resolved
tolusha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| type BackupCronJobConfig struct { | ||
tolusha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Enable determines whether backup CronJobs should be created for workspace PVCs. | ||
| // Defaults to false if not specified. | ||
| // +kubebuilder:validation:Optional | ||
| Enable *bool `json:"enable,omitempty"` | ||
rohanKanojia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // RegistryConfig defines the registry configuration where backup images are stored. | ||
| // +kubebuilder:validation:Required | ||
| Registry *RegistryConfig `json:"registry,omitempty"` | ||
| // OrasConfig defines additional configuration options for the oras CLI used to | ||
| // push and pull backup images. | ||
| OrasConfig *OrasConfig `json:"oras,omitempty"` | ||
| // Schedule specifies the cron schedule for the backup cron job. | ||
| // For example, "0 1 * * *" runs daily at 1 AM. | ||
| // +kubebuilder:default:="0 1 * * *" | ||
| // +kubebuilder:validation:Optional | ||
| Schedule string `json:"schedule,omitempty"` | ||
| } | ||
|
|
||
| type RoutingConfig struct { | ||
| // DefaultRoutingClass specifies the routingClass to be used when a DevWorkspace | ||
| // specifies an empty `.spec.routingClass`. Supported routingClasses can be defined | ||
|
|
@@ -189,6 +228,8 @@ type WorkspaceConfig struct { | |
| RuntimeClassName *string `json:"runtimeClassName,omitempty"` | ||
| // CleanupCronJobConfig defines configuration options for a cron job that automatically cleans up stale DevWorkspaces. | ||
| CleanupCronJob *CleanupCronJobConfig `json:"cleanupCronJob,omitempty"` | ||
| // BackupCronJobConfig defines configuration options for a cron job that automatically backs up workspace PVCs. | ||
| BackupCronJob *BackupCronJobConfig `json:"backupCronJob,omitempty"` | ||
| // PostStartTimeout defines the maximum duration the PostStart hook can run | ||
| // before it is automatically failed. This timeout is used for the postStart lifecycle hook | ||
| // that is used to run commands in the workspace container. The timeout is specified in seconds. | ||
|
|
@@ -331,14 +372,26 @@ type ConfigmapReference struct { | |
| Namespace string `json:"namespace"` | ||
| } | ||
|
|
||
| type OperatorConfigurationStatus struct { | ||
| // Conditions represent the latest available observations of the OperatorConfiguration's state | ||
| Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
| // LastBackupTime is the timestamp of the last successful backup. Nil if | ||
| // no backup is configured or no backup has yet succeeded. | ||
| LastBackupTime *metav1.Time `json:"lastBackupTime,omitempty"` | ||
tolusha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| // DevWorkspaceOperatorConfig is the Schema for the devworkspaceoperatorconfigs API | ||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:resource:path=devworkspaceoperatorconfigs,scope=Namespaced,shortName=dwoc | ||
| type DevWorkspaceOperatorConfig struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Config *OperatorConfiguration `json:"config,omitempty"` | ||
| // Status represents the current status of the DevWorkspaceOperatorConfig | ||
| // automatically managed by the DevWorkspace Operator. | ||
| Status *OperatorConfigurationStatus `json:"status,omitempty"` | ||
| } | ||
|
|
||
| // DevWorkspaceOperatorConfigList contains a list of DevWorkspaceOperatorConfig | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.