Skip to content

Commit 56e6e71

Browse files
committed
initial design thoughts
1 parent db470a7 commit 56e6e71

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed
+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Kopia Backup to Local Volume Provider (PVC/NFS)
2+
3+
_Note_: The preferred style for design documents is one sentence per line.
4+
*Do not wrap lines*.
5+
This aids in review of the document as changes to a line are not obscured by the reflowing those changes caused and has a side effect of avoiding debate about one or two space after a period.
6+
7+
_Note_: The name of the file should follow the name pattern `<short meaningful words joined by '-'>_design.md`, e.g:
8+
`listener-design.md`.
9+
10+
## Abstract
11+
Backups involving kopia are currently stored to blob storage only, this proposal aims to add support for storing backups to local volumes (PVC/NFS).
12+
13+
## Background
14+
Users have asked for the ability to store backups to local volumes (PVC/NFS) for various reasons including:
15+
- Compliance requirements
16+
- Cost
17+
- Existing infrastructure
18+
- Performance
19+
- Flexibility
20+
21+
## Goals
22+
<!-- - A short list of things which will be accomplished by implementing this proposal.
23+
- Two things is ok.
24+
- Three is pushing it.
25+
- More than three goals suggests that the proposal's scope is too large. -->
26+
27+
## Non Goals
28+
<!-- - A short list of items which are:
29+
- a. out of scope
30+
- b. follow on items which are deliberately excluded from this proposal. -->
31+
32+
33+
## High-Level Design
34+
if backup storage location is a local volume (PVC/NFS) then:
35+
36+
Add a new backend type `PVCBackend` to `pkg/repository/config/config.go`
37+
38+
```go
39+
const (
40+
AWSBackend BackendType = "velero.io/aws"
41+
AzureBackend BackendType = "velero.io/azure"
42+
GCPBackend BackendType = "velero.io/gcp"
43+
FSBackend BackendType = "velero.io/fs"
44+
PVCBackend BackendType = "replicated.com/pvc"
45+
)
46+
```
47+
48+
This plugin will be responsible for storing backups to a local volume PVC which can be NFS backed.
49+
50+
When `PVCBackend` is configured, velero will use kopia to store backups to the local volume instead of blob storage.
51+
52+
## Detailed Design
53+
A detailed design describing how the changes to the product should be made.
54+
55+
The names of types, fields, interfaces, and methods should be agreed on here, not debated in code review.
56+
The same applies to changes in CRDs, YAML examples, and so on.
57+
58+
Ideally the changes should be made in sequence so that the work required to implement this design can be done incrementally, possibly in parallel.
59+
60+
## Alternatives Considered
61+
If there are alternative high level or detailed designs that were not pursued they should be called out here with a brief explanation of why they were not pursued.
62+
63+
## Security Considerations
64+
If this proposal has an impact to the security of the product, its users, or data stored or transmitted via the product, they must be addressed here.
65+
66+
## Compatibility
67+
A discussion of any compatibility issues that need to be considered
68+
69+
## Implementation
70+
A description of the implementation, timelines, and any resources that have agreed to contribute.
71+
72+
## Open Issues
73+
<!-- A discussion of issues relating to this proposal for which the author does not know the solution. This section may be omitted if there are none. -->
74+
75+
Velero Logs, Velero Downloads will still not work and will be solved in [Download server for Velero client #6167
76+
](https://github.com/vmware-tanzu/velero/issues/6167)

pkg/repository/config/config.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const (
3434
AzureBackend BackendType = "velero.io/azure"
3535
GCPBackend BackendType = "velero.io/gcp"
3636
FSBackend BackendType = "velero.io/fs"
37+
PVCBackend BackendType = "replicated.com/pvc"
3738

3839
// CredentialsFileKey is the key within a BSL config that is checked to see if
3940
// the BSL is using its own credentials, rather than those in the environment
@@ -109,7 +110,7 @@ func GetBackendType(provider string, config map[string]string) BackendType {
109110
}
110111

111112
func IsBackendTypeValid(backendType BackendType) bool {
112-
return (backendType == AWSBackend || backendType == AzureBackend || backendType == GCPBackend || backendType == FSBackend)
113+
return (backendType == AWSBackend || backendType == AzureBackend || backendType == GCPBackend || backendType == FSBackend || backendType == PVCBackend)
113114
}
114115

115116
// GetRepoIdentifier returns the string to be used as the value of the --repo flag in

pkg/repository/provider/unified_repo.go

+2
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@ func getStorageType(backupLocation *velerov1api.BackupStorageLocation) string {
444444
return udmrepo.StorageTypeGcs
445445
case repoconfig.FSBackend:
446446
return udmrepo.StorageTypeFs
447+
case repoconfig.PVCBackend:
448+
return udmrepo.StorageTypeFs
447449
default:
448450
return ""
449451
}

0 commit comments

Comments
 (0)