diff --git a/docs/content/en/references/fleet_v1alpha1_types.html b/docs/content/en/references/fleet_v1alpha1_types.html index 4beb227b0..8978474d7 100644 --- a/docs/content/en/references/fleet_v1alpha1_types.html +++ b/docs/content/en/references/fleet_v1alpha1_types.html @@ -111,10 +111,208 @@

Fleet +

BackupConfig +

+

+(Appears on: +PluginConfig) +

+

BackupConfig defines the configuration for backups.

+
+
+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+chart
+ + +ChartConfig + + +
+(Optional) +

Chart defines the helm chart configuration of the backup engine. +The default value is:

+

chart: +repository: https://vmware-tanzu.github.io/helm-charts +name: velero +version: 5.0.2

+
+storage
+ + +BackupStorage + + +
+

Storage provides details on where the backup data should be stored.

+
+extraArgs
+ + +Kubernetes /apiextensions/v1.JSON + + +
+(Optional) +

ExtraArgs provides the extra chart values for the backup engine chart. +For example, use the following configuration to change the image tag or pull policy:

+

extraArgs: +image: +repository: velero/velero +tag: v1.11.1 +pullPolicy: IfNotPresent

+
+
+
+

BackupStorage +

+

+(Appears on: +BackupConfig) +

+
+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+location
+ + +BackupStorageLocation + + +
+

Location specifies where the backup data will be stored.

+
+secretName
+ +string + +
+

SecretName represents the name of the secret containing the object store credentials. +To access the backup storage location, the secret must include the following keys:

+
    +
  • access-key: The access-key/account/username for object storage authentication.
  • +
  • secret-key: The secret-key/password for object storage authentication.
  • +
+
+
+
+

BackupStorageLocation +

+

+(Appears on: +BackupStorage) +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+bucket
+ +string + +
+

Bucket specifies the storage bucket name.

+
+provider
+ +string + +
+

Provider specifies the storage provider type (e.g., aws, gcp, azure).

+
+endpoint
+ +string + +
+

Endpoint provides the endpoint URL for the storage.

+
+region
+ +string + +
+

Region specifies the region of the storage.

+
+config
+ +map[string]string + +
+

Config is a map for additional provider-specific configurations.

+
+
+

ChartConfig

(Appears on: +BackupConfig, GrafanaConfig, KyvernoConfig, PrometheusConfig, @@ -594,6 +792,19 @@

PluginConfig

Policy defines the configuration for the ploicy management.

+ + +backup
+ + +BackupConfig + + + + +

Backup defines the configuration for the backup engine(Velero).

+ + diff --git a/manifests/charts/fleet-manager/crds/fleet.kurator.dev_fleet.yaml b/manifests/charts/fleet-manager/crds/fleet.kurator.dev_fleet.yaml index da975c7e2..69d44e6b3 100644 --- a/manifests/charts/fleet-manager/crds/fleet.kurator.dev_fleet.yaml +++ b/manifests/charts/fleet-manager/crds/fleet.kurator.dev_fleet.yaml @@ -111,6 +111,84 @@ spec: description: Plugin defines the plugins that would be installed in the fleet. properties: + backup: + description: Backup defines the configuration for the backup engine(Velero). + properties: + chart: + description: "Chart defines the helm chart configuration of + the backup engine. The default value is: \n chart: repository: + https://vmware-tanzu.github.io/helm-charts name: velero + version: 5.0.2" + properties: + name: + description: Name defines the name of the chart. Default + value depends on the kind of the component. + type: string + repository: + description: Repository defines the repository of chart. + Default value depends on the kind of the component. + type: string + version: + description: Version defines the version of the chart. + Default value depends on the kind of the component. + type: string + type: object + extraArgs: + description: "ExtraArgs provides the extra chart values for + the backup engine chart. For example, use the following + configuration to change the image tag or pull policy: \n + extraArgs: image: repository: velero/velero tag: v1.11.1 + pullPolicy: IfNotPresent" + x-kubernetes-preserve-unknown-fields: true + storage: + description: Storage provides details on where the backup + data should be stored. + properties: + location: + description: Location specifies where the backup data + will be stored. + properties: + bucket: + description: Bucket specifies the storage bucket name. + type: string + config: + additionalProperties: + type: string + description: Config is a map for additional provider-specific + configurations. + type: object + endpoint: + description: Endpoint provides the endpoint URL for + the storage. + type: string + provider: + description: Provider specifies the storage provider + type (e.g., aws, gcp, azure). + type: string + region: + description: Region specifies the region of the storage. + type: string + required: + - bucket + - endpoint + - provider + - region + type: object + secretName: + description: "SecretName represents the name of the secret + containing the object store credentials. To access the + backup storage location, the secret must include the + following keys: \n - `access-key`: The access-key/account/username + for object storage authentication. - `secret-key`: The + secret-key/password for object storage authentication." + type: string + required: + - location + - secretName + type: object + required: + - storage + type: object grafana: description: Grafana defines the configuration for the grafana installation and observation. diff --git a/pkg/apis/fleet/v1alpha1/types.go b/pkg/apis/fleet/v1alpha1/types.go index c6b796e8a..47faf0ae1 100644 --- a/pkg/apis/fleet/v1alpha1/types.go +++ b/pkg/apis/fleet/v1alpha1/types.go @@ -81,6 +81,8 @@ type PluginConfig struct { Grafana *GrafanaConfig `json:"grafana,omitempty"` // Policy defines the configuration for the ploicy management. Policy *PolicyConfig `json:"policy,omitempty"` + // Backup defines the configuration for the backup engine(Velero). + Backup *BackupConfig `json:"backup,omitempty"` } type MetricConfig struct { @@ -248,6 +250,62 @@ type PodSecurityPolicy struct { ValidationFailureAction string `json:"validationFailureAction,omitempty"` } +// BackupConfig defines the configuration for backups. +type BackupConfig struct { + // Chart defines the helm chart configuration of the backup engine. + // The default value is: + // + // chart: + // repository: https://vmware-tanzu.github.io/helm-charts + // name: velero + // version: 5.0.2 + // + // +optional + Chart *ChartConfig `json:"chart,omitempty"` + + // Storage provides details on where the backup data should be stored. + Storage BackupStorage `json:"storage"` + + // ExtraArgs provides the extra chart values for the backup engine chart. + // For example, use the following configuration to change the image tag or pull policy: + // + // extraArgs: + // image: + // repository: velero/velero + // tag: v1.11.1 + // pullPolicy: IfNotPresent + // + // +optional + ExtraArgs apiextensionsv1.JSON `json:"extraArgs,omitempty"` +} + +type BackupStorage struct { + // Location specifies where the backup data will be stored. + Location BackupStorageLocation `json:"location"` + + // SecretName represents the name of the secret containing the object store credentials. + // To access the backup storage location, the secret must include the following keys: + // + // - `access-key`: The access-key/account/username for object storage authentication. + // - `secret-key`: The secret-key/password for object storage authentication. + // + // +required + SecretName string `json:"secretName"` +} + +type BackupStorageLocation struct { + // Bucket specifies the storage bucket name. + Bucket string `json:"bucket"` + // Provider specifies the storage provider type (e.g., aws, gcp, azure). + Provider string `json:"provider"` + // Endpoint provides the endpoint URL for the storage. + Endpoint string `json:"endpoint"` + // Region specifies the region of the storage. + Region string `json:"region"` + // Config is a map for additional provider-specific configurations. + Config map[string]string `json:"config,omitempty"` +} + // FleetStatus defines the observed state of the fleet type FleetStatus struct { // CredentialSecret is the secret name that holds credentials used for accessing the fleet control plane. diff --git a/pkg/apis/fleet/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/fleet/v1alpha1/zz_generated.deepcopy.go index 98c8e0531..d960873ed 100644 --- a/pkg/apis/fleet/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/fleet/v1alpha1/zz_generated.deepcopy.go @@ -26,6 +26,69 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupConfig) DeepCopyInto(out *BackupConfig) { + *out = *in + if in.Chart != nil { + in, out := &in.Chart, &out.Chart + *out = new(ChartConfig) + **out = **in + } + in.Storage.DeepCopyInto(&out.Storage) + in.ExtraArgs.DeepCopyInto(&out.ExtraArgs) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfig. +func (in *BackupConfig) DeepCopy() *BackupConfig { + if in == nil { + return nil + } + out := new(BackupConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupStorage) DeepCopyInto(out *BackupStorage) { + *out = *in + in.Location.DeepCopyInto(&out.Location) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupStorage. +func (in *BackupStorage) DeepCopy() *BackupStorage { + if in == nil { + return nil + } + out := new(BackupStorage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupStorageLocation) DeepCopyInto(out *BackupStorageLocation) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupStorageLocation. +func (in *BackupStorageLocation) DeepCopy() *BackupStorageLocation { + if in == nil { + return nil + } + out := new(BackupStorageLocation) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ChartConfig) DeepCopyInto(out *ChartConfig) { *out = *in @@ -292,6 +355,11 @@ func (in *PluginConfig) DeepCopyInto(out *PluginConfig) { *out = new(PolicyConfig) (*in).DeepCopyInto(*out) } + if in.Backup != nil { + in, out := &in.Backup, &out.Backup + *out = new(BackupConfig) + (*in).DeepCopyInto(*out) + } return }