Skip to content

Commit e7174b2

Browse files
authored
Merge branch 'main' into hxu/backup-default-image-type
2 parents e30ea1c + 13a0b20 commit e7174b2

38 files changed

+801
-323
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG FDB_VERSION=7.1.67
44
ARG FDB_WEBSITE=https://github.com/apple/foundationdb/releases/download
55

66
# Build the manager binary
7-
FROM docker.io/library/golang:1.24.6 AS builder
7+
FROM docker.io/library/golang:1.24.6-bookworm AS builder
88

99
ARG FDB_VERSION
1010
ARG FDB_WEBSITE

api/v1beta2/foundationdb_process_class.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
// ProcessClass models the class of a pod
2828
type ProcessClass string
2929

30+
// See https://github.com/apple/foundationdb/blob/release-7.1/fdbrpc/Locality.cpp for additional information regarding the
31+
// process classes and process roles.
3032
const (
3133
// ProcessClassStorage model for FDB class storage
3234
ProcessClassStorage ProcessClass = "storage"
@@ -50,6 +52,8 @@ const (
5052
ProcessClassCommitProxy ProcessClass = "commit_proxy"
5153
// ProcessClassGrvProxy model for FDB grv_proxy processes
5254
ProcessClassGrvProxy ProcessClass = "grv_proxy"
55+
// ProcessClassBackup model for FDB backup processes
56+
ProcessClassBackup ProcessClass = "backup"
5357
)
5458

5559
// IsStateful determines whether a process class should store data.

api/v1beta2/foundationdbbackup_types.go

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
// +kubebuilder:object:root=true
3131
// +kubebuilder:resource:shortName=fdbbackup
3232
// +kubebuilder:subresource:status
33-
// +kubebuilder:metadata:annotations="foundationdb.org/release=v2.11.0"
33+
// +kubebuilder:metadata:annotations="foundationdb.org/release=v2.12.0"
3434
// +kubebuilder:printcolumn:name="Generation",type="integer",JSONPath=".metadata.generation",description="Latest generation of the spec",priority=0
3535
// +kubebuilder:printcolumn:name="Reconciled",type="integer",JSONPath=".status.generations.reconciled",description="Last reconciled generation of the spec",priority=0
3636
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
@@ -117,8 +117,30 @@ type FoundationDBBackupSpec struct {
117117
// +kubebuilder:validation:Enum=split;unified
118118
// +kubebuilder:default:=split
119119
ImageType *ImageType `json:"imageType,omitempty"`
120+
121+
// BackupType defines the backup type that should be used for the backup. When the BackupType is set to
122+
// BackupTypePartitionedLog, it's expected that the FoundationDBCluster creates and manages the additional
123+
// backup worker processes. A migration to a different backup type is not yet supported in the operator.
124+
// Default: "backup_agent".
125+
// +kubebuilder:validation:Optional
126+
// +kubebuilder:validation:Enum=backup_agent;partitioned_log
127+
// +kubebuilder:default:=backup_agent
128+
BackupType *BackupType `json:"backupType,omitempty"`
120129
}
121130

131+
// BackupType defines the backup type that should be used for the backup.
132+
// +kubebuilder:validation:MaxLength=64
133+
type BackupType string
134+
135+
const (
136+
// BackupTypeDefault refers to the current default backup type with additional backup agents.
137+
BackupTypeDefault BackupType = "backup_agent"
138+
139+
// BackupTypePartitionedLog refers to the new partitioned log backup system, see
140+
// https://github.com/apple/foundationdb/blob/main/design/backup_v2_partitioned_logs.md.
141+
BackupTypePartitionedLog BackupType = "partitioned_log"
142+
)
143+
122144
// FoundationDBBackupStatus describes the current status of the backup for a cluster.
123145
type FoundationDBBackupStatus struct {
124146
// AgentCount provides the number of agents that are up-to-date, ready,
@@ -279,6 +301,18 @@ type FoundationDBLiveBackupStatus struct {
279301
type FoundationDBLiveBackupStatusState struct {
280302
// Running determines whether the backup is currently running.
281303
Running bool `json:"Running,omitempty"`
304+
305+
// Restorable if true, the backup can be restored
306+
Restorable *bool `json:"Restorable,omitempty"`
307+
308+
// LatestRestorablePoint contains information about the latest restorable point if any exists.
309+
LatestRestorablePoint *LatestRestorablePoint `json:"LatestRestorablePoint,omitempty"`
310+
}
311+
312+
// LatestRestorablePoint contains information about the latest restorable point if any exists.
313+
type LatestRestorablePoint struct {
314+
// Version is the version that can be restored to.
315+
Version *uint64 `json:"Version,omitempty"`
282316
}
283317

284318
// GetDesiredAgentCount determines how many backup agents we should run
@@ -331,11 +365,34 @@ func (backup *FoundationDBBackup) CheckReconciliation() (bool, error) {
331365
return reconciled, nil
332366
}
333367

368+
// GetBackupType returns the backup type for the backup.
369+
func (backup *FoundationDBBackup) GetBackupType() BackupType {
370+
if backup.Spec.BackupType != nil {
371+
return *backup.Spec.BackupType
372+
}
373+
374+
return BackupTypeDefault
375+
}
376+
334377
// GetAllowTagOverride returns the bool value for AllowTagOverride
335378
func (foundationDBBackupSpec *FoundationDBBackupSpec) GetAllowTagOverride() bool {
336379
return ptr.Deref(foundationDBBackupSpec.AllowTagOverride, false)
337380
}
338381

382+
// GetEncryptionKey returns the encryption key path if the current version supports encrypted backups.
383+
func (backup *FoundationDBBackup) GetEncryptionKey() (string, error) {
384+
fdbVersion, err := ParseFdbVersion(backup.Spec.Version)
385+
if err != nil {
386+
return "", err
387+
}
388+
389+
if !fdbVersion.SupportsBackupEncryption() {
390+
return "", nil
391+
}
392+
393+
return backup.Spec.EncryptionKeyPath, nil
394+
}
395+
339396
// UseUnifiedImage returns true if the unified image should be used.
340397
func (backup *FoundationDBBackup) UseUnifiedImage() bool {
341398
imageType := ImageTypeUnified

api/v1beta2/foundationdbcluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
// +kubebuilder:object:root=true
4040
// +kubebuilder:resource:shortName=fdb
4141
// +kubebuilder:subresource:status
42-
// +kubebuilder:metadata:annotations="foundationdb.org/release=v2.11.0"
42+
// +kubebuilder:metadata:annotations="foundationdb.org/release=v2.12.0"
4343
// +kubebuilder:printcolumn:name="Generation",type="integer",JSONPath=".metadata.generation",description="Latest generation of the spec",priority=0
4444
// +kubebuilder:printcolumn:name="Reconciled",type="integer",JSONPath=".status.generations.reconciled",description="Last reconciled generation of the spec",priority=0
4545
// +kubebuilder:printcolumn:name="Available",type="boolean",JSONPath=".status.health.available",description="Database available",priority=0

api/v1beta2/foundationdbrestore_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
// +kubebuilder:object:root=true
2424
// +kubebuilder:resource:shortName=fdbrestore
2525
// +kubebuilder:subresource:status
26-
// +kubebuilder:metadata:annotations="foundationdb.org/release=v2.11.0"
26+
// +kubebuilder:metadata:annotations="foundationdb.org/release=v2.12.0"
2727
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
2828
// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
2929
// +kubebuilder:storageversion

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 36 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/fdb-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ type: application
1818
version: 0.2.0
1919
# This is the version number of the application being deployed. This version number should be
2020
# incremented each time you make changes to the application.
21-
appVersion: v2.11.0
21+
appVersion: v2.12.0
2222
maintainers:
2323
- name: "foundationdb-ci"

charts/fdb-operator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
image:
33
repository: foundationdb/fdb-kubernetes-operator
4-
tag: v2.11.0
4+
tag: v2.12.0
55
pullPolicy: IfNotPresent
66
initContainers:
77
7.1:

config/crd/bases/apps.foundationdb.org_foundationdbbackups.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.18.0
7-
foundationdb.org/release: v2.11.0
7+
foundationdb.org/release: v2.12.0
88
name: foundationdbbackups.apps.foundationdb.org
99
spec:
1010
group: apps.foundationdb.org
@@ -71,6 +71,13 @@ spec:
7171
- Stopped
7272
- Paused
7373
type: string
74+
backupType:
75+
default: backup_agent
76+
enum:
77+
- backup_agent
78+
- partitioned_log
79+
maxLength: 64
80+
type: string
7481
blobStoreConfiguration:
7582
properties:
7683
accountName:

config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.18.0
7-
foundationdb.org/release: v2.11.0
7+
foundationdb.org/release: v2.12.0
88
name: foundationdbclusters.apps.foundationdb.org
99
spec:
1010
group: apps.foundationdb.org

0 commit comments

Comments
 (0)