Skip to content

Commit 429c067

Browse files
authored
Add utilityVolumes and incrementalBackup feature gates (#4020)
* api: add IncrementalBackup variable to enable backup featuregates Once set to true, HCO will enable both IncrementalBackup and UtilityVolumes features gates in the kubevirt CR. This feature gates allow to perform storage based backups and incremental backup in kubevirt using QEMU capabilities. Signed-off-by: Shelly Kagan <skagan@redhat.com> * tests: Include functional and unit test coverage for IncrementalBackup feature gate Signed-off-by: Shelly Kagan <skagan@redhat.com> * docs: Include documentation coverage for IncrementalBackup feature gate Signed-off-by: Shelly Kagan <skagan@redhat.com> --------- Signed-off-by: Shelly Kagan <skagan@redhat.com>
1 parent b75cf31 commit 429c067

File tree

17 files changed

+130
-5
lines changed

17 files changed

+130
-5
lines changed

api/v1beta1/hyperconverged_types.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type HyperConvergedSpec struct {
6767

6868
// featureGates is a map of feature gate flags. Setting a flag to `true` will enable
6969
// the feature. Setting `false` or removing the feature gate, disables the feature.
70-
// +kubebuilder:default={"downwardMetrics": false, "deployKubeSecondaryDNS": false, "disableMDevConfiguration": false, "persistentReservation": false, "enableMultiArchBootImageImport": false, "decentralizedLiveMigration": true, "declarativeHotplugVolumes": false, "videoConfig": true, "objectGraph": false}
70+
// +kubebuilder:default={"downwardMetrics": false, "deployKubeSecondaryDNS": false, "disableMDevConfiguration": false, "persistentReservation": false, "enableMultiArchBootImageImport": false, "decentralizedLiveMigration": true, "declarativeHotplugVolumes": false, "videoConfig": true, "objectGraph": false, "incrementalBackup": false}
7171
// +optional
7272
FeatureGates HyperConvergedFeatureGates `json:"featureGates,omitempty"`
7373

@@ -550,6 +550,14 @@ type HyperConvergedFeatureGates struct {
550550
// +kubebuilder:default=false
551551
// +default=false
552552
ObjectGraph *bool `json:"objectGraph,omitempty"`
553+
554+
// IncrementalBackup enables changed block tracking backups and incremental backups using QEMU capabilities in KubeVirt.
555+
// When enabled, this also enables the UtilityVolumes feature gate in the KubeVirt CR.
556+
// Note: This feature is in Tech Preview.
557+
// +optional
558+
// +kubebuilder:default=false
559+
// +default=false
560+
IncrementalBackup *bool `json:"incrementalBackup,omitempty"`
553561
}
554562

555563
// PermittedHostDevices holds information about devices allowed for passthrough
@@ -943,7 +951,7 @@ type HyperConverged struct {
943951
metav1.TypeMeta `json:",inline"`
944952
metav1.ObjectMeta `json:"metadata,omitempty"`
945953

946-
// +kubebuilder:default={"certConfig": {"ca": {"duration": "48h0m0s", "renewBefore": "24h0m0s"}, "server": {"duration": "24h0m0s", "renewBefore": "12h0m0s"}},"featureGates": {"downwardMetrics": false, "deployKubeSecondaryDNS": false, "disableMDevConfiguration": false, "persistentReservation": false, "enableMultiArchBootImageImport": false, "decentralizedLiveMigration": true, "declarativeHotplugVolumes": false, "videoConfig": true, "objectGraph": false}, "liveMigrationConfig": {"completionTimeoutPerGiB": 150, "parallelMigrationsPerCluster": 5, "parallelOutboundMigrationsPerNode": 2, "progressTimeout": 150, "allowAutoConverge": false, "allowPostCopy": false}, "resourceRequirements": {"vmiCPUAllocationRatio": 10}, "uninstallStrategy": "BlockUninstallIfWorkloadsExist", "virtualMachineOptions": {"disableFreePageReporting": false, "disableSerialConsoleLog": false}, "enableApplicationAwareQuota": false, "enableCommonBootImageImport": true, "deployVmConsoleProxy": false}
954+
// +kubebuilder:default={"certConfig": {"ca": {"duration": "48h0m0s", "renewBefore": "24h0m0s"}, "server": {"duration": "24h0m0s", "renewBefore": "12h0m0s"}},"featureGates": {"downwardMetrics": false, "deployKubeSecondaryDNS": false, "disableMDevConfiguration": false, "persistentReservation": false, "enableMultiArchBootImageImport": false, "decentralizedLiveMigration": true, "declarativeHotplugVolumes": false, "videoConfig": true, "objectGraph": false, "incrementalBackup": false}, "liveMigrationConfig": {"completionTimeoutPerGiB": 150, "parallelMigrationsPerCluster": 5, "parallelOutboundMigrationsPerNode": 2, "progressTimeout": 150, "allowAutoConverge": false, "allowPostCopy": false}, "resourceRequirements": {"vmiCPUAllocationRatio": 10}, "uninstallStrategy": "BlockUninstallIfWorkloadsExist", "virtualMachineOptions": {"disableFreePageReporting": false, "disableSerialConsoleLog": false}, "enableApplicationAwareQuota": false, "enableCommonBootImageImport": true, "deployVmConsoleProxy": false}
947955
// +optional
948956
Spec HyperConvergedSpec `json:"spec,omitempty"`
949957
Status HyperConvergedStatus `json:"status,omitempty"`

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/zz_generated.defaults.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/zz_generated.openapi.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/hco.kubevirt.io_hyperconvergeds.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ spec:
6666
disableMDevConfiguration: false
6767
downwardMetrics: false
6868
enableMultiArchBootImageImport: false
69+
incrementalBackup: false
6970
objectGraph: false
7071
persistentReservation: false
7172
videoConfig: true
@@ -1093,6 +1094,7 @@ spec:
10931094
disableMDevConfiguration: false
10941095
downwardMetrics: false
10951096
enableMultiArchBootImageImport: false
1097+
incrementalBackup: false
10961098
objectGraph: false
10971099
persistentReservation: false
10981100
videoConfig: true
@@ -1173,6 +1175,13 @@ spec:
11731175
11741176
This feature is in Developer Preview.
11751177
type: boolean
1178+
incrementalBackup:
1179+
default: false
1180+
description: |-
1181+
IncrementalBackup enables changed block tracking backups and incremental backups using QEMU capabilities in KubeVirt.
1182+
When enabled, this also enables the UtilityVolumes feature gate in the KubeVirt CR.
1183+
Note: This feature is in Tech Preview.
1184+
type: boolean
11761185
nonRoot:
11771186
description: 'Deprecated: // Deprecated: This field is ignored
11781187
and will be removed on the next version of the API.'

controllers/handlers/kubevirt.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ const (
159159
kvDecentralizedLiveMigration = "DecentralizedLiveMigration"
160160
kvVideoConfig = "VideoConfig"
161161
kvObjectGraph = "ObjectGraph"
162+
kvUtilityVolumes = "UtilityVolumes"
163+
kvIncrementalBackup = "IncrementalBackup"
162164
)
163165

164166
// CPU Plugin default values
@@ -940,6 +942,11 @@ func getFeatureGateChecks(featureGates *hcov1beta1.HyperConvergedFeatureGates, a
940942
fgs = append(fgs, kvSecureExecution)
941943
}
942944

945+
if ptr.Deref(featureGates.IncrementalBackup, false) {
946+
fgs = append(fgs, kvIncrementalBackup)
947+
fgs = append(fgs, kvUtilityVolumes)
948+
}
949+
943950
return fgs
944951
}
945952

controllers/handlers/kubevirt_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,6 +2216,30 @@ Version: 1.2.3`)
22162216
},
22172217
Not(ContainElement(kvObjectGraph)),
22182218
),
2219+
Entry("should add both IncrementalBackup and UtilityVolumes feature gates if IncrementalBackup is true in HyperConverged CR",
2220+
func(hc *hcov1beta1.HyperConverged) {
2221+
hc.Spec.FeatureGates = hcov1beta1.HyperConvergedFeatureGates{
2222+
IncrementalBackup: ptr.To(true),
2223+
}
2224+
},
2225+
ContainElements(kvIncrementalBackup, kvUtilityVolumes),
2226+
),
2227+
Entry("should not add IncrementalBackup or UtilityVolumes feature gates if IncrementalBackup is false in HyperConverged CR",
2228+
func(hc *hcov1beta1.HyperConverged) {
2229+
hc.Spec.FeatureGates = hcov1beta1.HyperConvergedFeatureGates{
2230+
IncrementalBackup: ptr.To(false),
2231+
}
2232+
},
2233+
And(Not(ContainElement(kvIncrementalBackup)), Not(ContainElement(kvUtilityVolumes))),
2234+
),
2235+
Entry("should not add IncrementalBackup or UtilityVolumes feature gates if IncrementalBackup is not set in HyperConverged CR",
2236+
func(hc *hcov1beta1.HyperConverged) {
2237+
hc.Spec.FeatureGates = hcov1beta1.HyperConvergedFeatureGates{
2238+
IncrementalBackup: nil,
2239+
}
2240+
},
2241+
And(Not(ContainElement(kvIncrementalBackup)), Not(ContainElement(kvUtilityVolumes))),
2242+
),
22192243
)
22202244

22212245
It("should add the VideoConfig if feature gate VideoConfig is true in HyperConverged CR", func() {

deploy/crds/hco00.crd.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ spec:
6666
disableMDevConfiguration: false
6767
downwardMetrics: false
6868
enableMultiArchBootImageImport: false
69+
incrementalBackup: false
6970
objectGraph: false
7071
persistentReservation: false
7172
videoConfig: true
@@ -1093,6 +1094,7 @@ spec:
10931094
disableMDevConfiguration: false
10941095
downwardMetrics: false
10951096
enableMultiArchBootImageImport: false
1097+
incrementalBackup: false
10961098
objectGraph: false
10971099
persistentReservation: false
10981100
videoConfig: true
@@ -1173,6 +1175,13 @@ spec:
11731175
11741176
This feature is in Developer Preview.
11751177
type: boolean
1178+
incrementalBackup:
1179+
default: false
1180+
description: |-
1181+
IncrementalBackup enables changed block tracking backups and incremental backups using QEMU capabilities in KubeVirt.
1182+
When enabled, this also enables the UtilityVolumes feature gate in the KubeVirt CR.
1183+
Note: This feature is in Tech Preview.
1184+
type: boolean
11761185
nonRoot:
11771186
description: 'Deprecated: // Deprecated: This field is ignored
11781187
and will be removed on the next version of the API.'

deploy/hco.cr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ spec:
2222
disableMDevConfiguration: false
2323
downwardMetrics: false
2424
enableMultiArchBootImageImport: false
25+
incrementalBackup: false
2526
objectGraph: false
2627
persistentReservation: false
2728
videoConfig: true

deploy/index-image/community-kubevirt-hyperconverged/1.18.0/manifests/hco00.crd.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ spec:
6666
disableMDevConfiguration: false
6767
downwardMetrics: false
6868
enableMultiArchBootImageImport: false
69+
incrementalBackup: false
6970
objectGraph: false
7071
persistentReservation: false
7172
videoConfig: true
@@ -1093,6 +1094,7 @@ spec:
10931094
disableMDevConfiguration: false
10941095
downwardMetrics: false
10951096
enableMultiArchBootImageImport: false
1097+
incrementalBackup: false
10961098
objectGraph: false
10971099
persistentReservation: false
10981100
videoConfig: true
@@ -1173,6 +1175,13 @@ spec:
11731175
11741176
This feature is in Developer Preview.
11751177
type: boolean
1178+
incrementalBackup:
1179+
default: false
1180+
description: |-
1181+
IncrementalBackup enables changed block tracking backups and incremental backups using QEMU capabilities in KubeVirt.
1182+
When enabled, this also enables the UtilityVolumes feature gate in the KubeVirt CR.
1183+
Note: This feature is in Tech Preview.
1184+
type: boolean
11761185
nonRoot:
11771186
description: 'Deprecated: // Deprecated: This field is ignored
11781187
and will be removed on the next version of the API.'

0 commit comments

Comments
 (0)