Skip to content

Commit ccb27c9

Browse files
committed
feat: add Velero plugin configuration schema and validation
Add support for configuring custom Velero plugins in the Embedded Cluster Config CRD. This is the first PR in a series to enable vendors to extend EC's disaster recovery capabilities with specialized backup plugins. Changes: - Add VeleroExtensions and VeleroPlugin types to ConfigSpec.Extensions - Regenerate CRD schema to include velero.plugins field with validation - Implement plugin validation in lint validator: - Validate image format (OCI reference format) - Detect duplicate plugin images - Check for required fields - Add comprehensive unit tests for validation logic - Update proposal document to track PR 1 completion The new configuration structure allows vendors to specify custom Velero plugins as OCI images that will be injected as initContainers into the Velero deployment. Image references support both explicit registry paths and short names that will use EC's proxy registry. Example configuration: extensions: velero: plugins: - image: myvendor/velero-postgresql:v1.0.0 - image: myvendor/velero-mongodb:v2.1.0 This sets the foundation for PR 2 which will implement the Helm values generation to actually inject these plugins into the Velero deployment. Refs: SC-131045 Signed-off-by: Evans Mungai <[email protected]>
1 parent 9787cb7 commit ccb27c9

File tree

11 files changed

+509
-1
lines changed

11 files changed

+509
-1
lines changed

kinds/apis/v1beta1/config_types.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,25 @@ type Helm struct {
142142
}
143143

144144
type Extensions struct {
145-
Helm *Helm `json:"helm,omitempty"`
145+
Helm *Helm `json:"helm,omitempty"`
146+
Velero VeleroExtensions `json:"velero,omitempty"`
147+
}
148+
149+
// VeleroExtensions contains Velero-specific extension settings
150+
type VeleroExtensions struct {
151+
// Plugins is a list of custom Velero plugins to be added as initContainers
152+
// +kubebuilder:validation:Optional
153+
Plugins []VeleroPlugin `json:"plugins,omitempty"`
154+
}
155+
156+
// VeleroPlugin defines a custom Velero plugin to be added to the Velero deployment
157+
type VeleroPlugin struct {
158+
// Image is the OCI image reference for the plugin container
159+
// Examples:
160+
// - "myvendor/velero-postgresql:v1.0.0" (explicit registry)
161+
// - "velero-plugin-postgres:v1.0.0" (will use proxy registry)
162+
// +kubebuilder:validation:Required
163+
Image string `json:"image"`
146164
}
147165

148166
type Domains struct {

kinds/apis/v1beta1/zz_generated.deepcopy.go

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

operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,29 @@ spec:
129129
type: object
130130
type: array
131131
type: object
132+
velero:
133+
description: VeleroExtensions contains Velero-specific extension
134+
settings
135+
properties:
136+
plugins:
137+
description: Plugins is a list of custom Velero plugins to
138+
be added as initContainers
139+
items:
140+
description: VeleroPlugin defines a custom Velero plugin
141+
to be added to the Velero deployment
142+
properties:
143+
image:
144+
description: |-
145+
Image is the OCI image reference for the plugin container
146+
Examples:
147+
- "myvendor/velero-postgresql:v1.0.0" (explicit registry)
148+
- "velero-plugin-postgres:v1.0.0" (will use proxy registry)
149+
type: string
150+
required:
151+
- image
152+
type: object
153+
type: array
154+
type: object
132155
type: object
133156
metadataOverrideUrl:
134157
type: string
@@ -451,6 +474,29 @@ spec:
451474
type: object
452475
type: array
453476
type: object
477+
velero:
478+
description: VeleroExtensions contains Velero-specific extension
479+
settings
480+
properties:
481+
plugins:
482+
description: Plugins is a list of custom Velero plugins
483+
to be added as initContainers
484+
items:
485+
description: VeleroPlugin defines a custom Velero plugin
486+
to be added to the Velero deployment
487+
properties:
488+
image:
489+
description: |-
490+
Image is the OCI image reference for the plugin container
491+
Examples:
492+
- "myvendor/velero-postgresql:v1.0.0" (explicit registry)
493+
- "velero-plugin-postgres:v1.0.0" (will use proxy registry)
494+
type: string
495+
required:
496+
- image
497+
type: object
498+
type: array
499+
type: object
454500
type: object
455501
metadataOverrideUrl:
456502
type: string

operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,29 @@ spec:
127127
type: object
128128
type: array
129129
type: object
130+
velero:
131+
description: VeleroExtensions contains Velero-specific extension
132+
settings
133+
properties:
134+
plugins:
135+
description: Plugins is a list of custom Velero plugins to
136+
be added as initContainers
137+
items:
138+
description: VeleroPlugin defines a custom Velero plugin
139+
to be added to the Velero deployment
140+
properties:
141+
image:
142+
description: |-
143+
Image is the OCI image reference for the plugin container
144+
Examples:
145+
- "myvendor/velero-postgresql:v1.0.0" (explicit registry)
146+
- "velero-plugin-postgres:v1.0.0" (will use proxy registry)
147+
type: string
148+
required:
149+
- image
150+
type: object
151+
type: array
152+
type: object
130153
type: object
131154
metadataOverrideUrl:
132155
type: string

operator/config/crd/bases/embeddedcluster.replicated.com_installations.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,29 @@ spec:
193193
type: object
194194
type: array
195195
type: object
196+
velero:
197+
description: VeleroExtensions contains Velero-specific extension
198+
settings
199+
properties:
200+
plugins:
201+
description: Plugins is a list of custom Velero plugins
202+
to be added as initContainers
203+
items:
204+
description: VeleroPlugin defines a custom Velero plugin
205+
to be added to the Velero deployment
206+
properties:
207+
image:
208+
description: |-
209+
Image is the OCI image reference for the plugin container
210+
Examples:
211+
- "myvendor/velero-postgresql:v1.0.0" (explicit registry)
212+
- "velero-plugin-postgres:v1.0.0" (will use proxy registry)
213+
type: string
214+
required:
215+
- image
216+
type: object
217+
type: array
218+
type: object
196219
type: object
197220
metadataOverrideUrl:
198221
type: string

operator/config/crd/bases/embeddedcluster.replicated.com_kubernetesinstallations.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,29 @@ spec:
152152
type: object
153153
type: array
154154
type: object
155+
velero:
156+
description: VeleroExtensions contains Velero-specific extension
157+
settings
158+
properties:
159+
plugins:
160+
description: Plugins is a list of custom Velero plugins
161+
to be added as initContainers
162+
items:
163+
description: VeleroPlugin defines a custom Velero plugin
164+
to be added to the Velero deployment
165+
properties:
166+
image:
167+
description: |-
168+
Image is the OCI image reference for the plugin container
169+
Examples:
170+
- "myvendor/velero-postgresql:v1.0.0" (explicit registry)
171+
- "velero-plugin-postgres:v1.0.0" (will use proxy registry)
172+
type: string
173+
required:
174+
- image
175+
type: object
176+
type: array
177+
type: object
155178
type: object
156179
metadataOverrideUrl:
157180
type: string

operator/schemas/config-embeddedcluster-v1beta1.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,29 @@
128128
}
129129
}
130130
}
131+
},
132+
"velero": {
133+
"description": "VeleroExtensions contains Velero-specific extension settings",
134+
"type": "object",
135+
"properties": {
136+
"plugins": {
137+
"description": "Plugins is a list of custom Velero plugins to be added as initContainers",
138+
"type": "array",
139+
"items": {
140+
"description": "VeleroPlugin defines a custom Velero plugin to be added to the Velero deployment",
141+
"type": "object",
142+
"required": [
143+
"image"
144+
],
145+
"properties": {
146+
"image": {
147+
"description": "Image is the OCI image reference for the plugin container\nExamples:\n - \"myvendor/velero-postgresql:v1.0.0\" (explicit registry)\n - \"velero-plugin-postgres:v1.0.0\" (will use proxy registry)",
148+
"type": "string"
149+
}
150+
}
151+
}
152+
}
153+
}
131154
}
132155
}
133156
},

operator/schemas/kubernetesinstallation-embeddedcluster-v1beta1.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,29 @@
154154
}
155155
}
156156
}
157+
},
158+
"velero": {
159+
"description": "VeleroExtensions contains Velero-specific extension settings",
160+
"type": "object",
161+
"properties": {
162+
"plugins": {
163+
"description": "Plugins is a list of custom Velero plugins to be added as initContainers",
164+
"type": "array",
165+
"items": {
166+
"description": "VeleroPlugin defines a custom Velero plugin to be added to the Velero deployment",
167+
"type": "object",
168+
"required": [
169+
"image"
170+
],
171+
"properties": {
172+
"image": {
173+
"description": "Image is the OCI image reference for the plugin container\nExamples:\n - \"myvendor/velero-postgresql:v1.0.0\" (explicit registry)\n - \"velero-plugin-postgres:v1.0.0\" (will use proxy registry)",
174+
"type": "string"
175+
}
176+
}
177+
}
178+
}
179+
}
157180
}
158181
}
159182
},

pkg/crds/resources.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,29 @@ spec:
129129
type: object
130130
type: array
131131
type: object
132+
velero:
133+
description: VeleroExtensions contains Velero-specific extension
134+
settings
135+
properties:
136+
plugins:
137+
description: Plugins is a list of custom Velero plugins to
138+
be added as initContainers
139+
items:
140+
description: VeleroPlugin defines a custom Velero plugin
141+
to be added to the Velero deployment
142+
properties:
143+
image:
144+
description: |-
145+
Image is the OCI image reference for the plugin container
146+
Examples:
147+
- "myvendor/velero-postgresql:v1.0.0" (explicit registry)
148+
- "velero-plugin-postgres:v1.0.0" (will use proxy registry)
149+
type: string
150+
required:
151+
- image
152+
type: object
153+
type: array
154+
type: object
132155
type: object
133156
metadataOverrideUrl:
134157
type: string
@@ -451,6 +474,29 @@ spec:
451474
type: object
452475
type: array
453476
type: object
477+
velero:
478+
description: VeleroExtensions contains Velero-specific extension
479+
settings
480+
properties:
481+
plugins:
482+
description: Plugins is a list of custom Velero plugins
483+
to be added as initContainers
484+
items:
485+
description: VeleroPlugin defines a custom Velero plugin
486+
to be added to the Velero deployment
487+
properties:
488+
image:
489+
description: |-
490+
Image is the OCI image reference for the plugin container
491+
Examples:
492+
- "myvendor/velero-postgresql:v1.0.0" (explicit registry)
493+
- "velero-plugin-postgres:v1.0.0" (will use proxy registry)
494+
type: string
495+
required:
496+
- image
497+
type: object
498+
type: array
499+
type: object
454500
type: object
455501
metadataOverrideUrl:
456502
type: string

0 commit comments

Comments
 (0)