Skip to content

Commit

Permalink
fleet: init backup plugin api
Browse files Browse the repository at this point in the history
Signed-off-by: Xieql <[email protected]>
  • Loading branch information
Xieql committed Sep 1, 2023
1 parent 20fd6ab commit 5264c2a
Show file tree
Hide file tree
Showing 4 changed files with 260 additions and 0 deletions.
111 changes: 111 additions & 0 deletions docs/content/en/references/fleet_v1alpha1_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,107 @@ <h3 id="fleet.kurator.dev/v1alpha1.Fleet">Fleet
</table>
</div>
</div>
<h3 id="fleet.kurator.dev/v1alpha1.BackupConfig">BackupConfig
</h3>
<p>
(<em>Appears on:</em>
<a href="#fleet.kurator.dev/v1alpha1.PluginConfig">PluginConfig</a>)
</p>
<p>BackupConfig defines the configuration for the Velero backup engine.</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table td-content">
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>chart</code><br>
<em>
<a href="#fleet.kurator.dev/v1alpha1.ChartConfig">
ChartConfig
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Chart defines the helm chart config of the velero.
default values is</p>
<p>chart:
repository: <a href="https://vmware-tanzu.github.io/helm-charts">https://vmware-tanzu.github.io/helm-charts</a>
name: velero
version: 5.0.2</p>
</td>
</tr>
<tr>
<td>
<code>storage</code><br>
<em>
<a href="#fleet.kurator.dev/v1alpha1.ObjectStoreConfig">
ObjectStoreConfig
</a>
</em>
</td>
<td>
<p>Storage details where the backup data should be stored.</p>
</td>
</tr>
<tr>
<td>
<code>veleroImage</code><br>
<em>
<a href="https://pkg.go.dev/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1?tab=doc#JSON">
Kubernetes /apiextensions/v1.JSON
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>VeleroImage Details of the container image to use in the Velero deployment &amp; daemonset
default values is</p>
<p>repository: velero/velero
tag: v1.11.1
pullPolicy: IfNotPresent</p>
</td>
</tr>
<tr>
<td>
<code>initContainers</code><br>
<em>
<a href="https://pkg.go.dev/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1?tab=doc#JSON">
Kubernetes /apiextensions/v1.JSON
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>InitContainers to add to the Velero deployment&rsquo;s pod spec.
default values is</p>
<ul>
<li>name: velero-plugin-for-aws
image: velero/velero-plugin-for-aws:v1.7.1
imagePullPolicy: IfNotPresent
volumeMounts:
<ul>
<li>mountPath: /target
name: plugins</li>
</ul></li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3 id="fleet.kurator.dev/v1alpha1.ChartConfig">ChartConfig
</h3>
<p>
(<em>Appears on:</em>
<a href="#fleet.kurator.dev/v1alpha1.BackupConfig">BackupConfig</a>,
<a href="#fleet.kurator.dev/v1alpha1.GrafanaConfig">GrafanaConfig</a>,
<a href="#fleet.kurator.dev/v1alpha1.KyvernoConfig">KyvernoConfig</a>,
<a href="#fleet.kurator.dev/v1alpha1.PrometheusConfig">PrometheusConfig</a>,
Expand Down Expand Up @@ -509,6 +606,7 @@ <h3 id="fleet.kurator.dev/v1alpha1.ObjectStoreConfig">ObjectStoreConfig
</h3>
<p>
(<em>Appears on:</em>
<a href="#fleet.kurator.dev/v1alpha1.BackupConfig">BackupConfig</a>,
<a href="#fleet.kurator.dev/v1alpha1.ThanosConfig">ThanosConfig</a>)
</p>
<div class="md-typeset__scrollwrap">
Expand Down Expand Up @@ -594,6 +692,19 @@ <h3 id="fleet.kurator.dev/v1alpha1.PluginConfig">PluginConfig
<p>Policy defines the configuration for the ploicy management.</p>
</td>
</tr>
<tr>
<td>
<code>backup</code><br>
<em>
<a href="#fleet.kurator.dev/v1alpha1.BackupConfig">
BackupConfig
</a>
</em>
</td>
<td>
<p>Backup defines the configuration for the backup engine(Velero).</p>
</td>
</tr>
</tbody>
</table>
</div>
Expand Down
48 changes: 48 additions & 0 deletions manifests/charts/fleet-manager/crds/fleet.kurator.dev_fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,54 @@ 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 config of the velero.
default values 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
initContainers:
description: "InitContainers to add to the Velero deployment's
pod spec. default values is \n - name: velero-plugin-for-aws
image: velero/velero-plugin-for-aws:v1.7.1 imagePullPolicy:
IfNotPresent volumeMounts: - mountPath: /target name: plugins"
x-kubernetes-preserve-unknown-fields: true
storage:
description: Storage details where the backup data should
be stored.
properties:
secretName:
description: SecretName is the name of the secret that
holds the object store configuration. The path of object
store configuration must be `objstore.yml`
type: string
required:
- secretName
type: object
veleroImage:
description: "VeleroImage Details of the container image to
use in the Velero deployment & daemonset default values
is \n repository: velero/velero tag: v1.11.1 pullPolicy:
IfNotPresent"
x-kubernetes-preserve-unknown-fields: true
required:
- storage
type: object
grafana:
description: Grafana defines the configuration for the grafana
installation and observation.
Expand Down
68 changes: 68 additions & 0 deletions pkg/apis/fleet/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -248,6 +250,72 @@ type PodSecurityPolicy struct {
ValidationFailureAction string `json:"validationFailureAction,omitempty"`
}

// BackupConfig defines the configuration for the Velero backup engine.
type BackupConfig struct {
// Chart defines the helm chart config of the velero.
// default values is
//
// chart:
// repository: https://vmware-tanzu.github.io/helm-charts
// name: velero
// version: 5.0.2
//
// +optional
Chart *ChartConfig `json:"chart,omitempty"`

// Storage details where the backup data should be stored.
Storage BackupStorage `json:"storage"`

// VeleroImage Details of the container image to use in the Velero deployment & daemonset
// default values is
//
// repository: velero/velero
// tag: v1.11.1
// pullPolicy: IfNotPresent
//
// +optional
VeleroImage apiextensionsv1.JSON `json:"veleroImage,omitempty"`

// InitContainers to add to the Velero deployment's pod spec.
// default values is
//
// - name: velero-plugin-for-aws
// image: velero/velero-plugin-for-aws:v1.7.1
// imagePullPolicy: IfNotPresent
// volumeMounts:
// - mountPath: /target
// name: plugins
//
// +optional
InitContainers apiextensionsv1.JSON `json:"initContainers,omitempty"`
}

type BackupStorage struct {
// Location specifies the location where the backup data will be stored.
Location BackupStorageLocation `json:"location"`

// Credentials to access the backup storage location.
Credentials BackupCredentials `json:"credentials"`
}

type BackupStorageLocation struct {
// Bucket specifies the storage bucket name.
Bucket string `json:"bucket"`
// Provider specifies the storage provider type (e.g., aws).
Provider string `json:"provider"`
// S3Url provides the endpoint URL for S3-compatible storage.
S3Url string `json:"s3Url"`
// Region specifies the region of the storage.
Region string `json:"region"`
}

type BackupCredentials struct {
// AccessKeyID is the identifier for the access key.
AccessKeyID string `json:"accessKeyID"`
// SecretAccessKey is the secret access key associated with AccessKeyID
SecretAccessKey string `json:"secretAccessKey"`
}

// 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.
Expand Down
33 changes: 33 additions & 0 deletions pkg/apis/fleet/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5264c2a

Please sign in to comment.