Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fleet: init backup plugin api #378

Merged
merged 7 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 211 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,208 @@ <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 backups.</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 configuration of the backup engine.
The default value 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.BackupStorage">
BackupStorage
</a>
</em>
</td>
<td>
<p>Storage provides details on where the backup data should be stored.</p>
</td>
</tr>
<tr>
<td>
<code>extraArgs</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>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:</p>
<p>extraArgs:
image:
repository: velero/velero
tag: v1.11.1
pullPolicy: IfNotPresent</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3 id="fleet.kurator.dev/v1alpha1.BackupStorage">BackupStorage
</h3>
<p>
(<em>Appears on:</em>
<a href="#fleet.kurator.dev/v1alpha1.BackupConfig">BackupConfig</a>)
</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>location</code><br>
<em>
<a href="#fleet.kurator.dev/v1alpha1.BackupStorageLocation">
BackupStorageLocation
</a>
</em>
</td>
<td>
<p>Location specifies where the backup data will be stored.</p>
</td>
</tr>
<tr>
<td>
<code>secretName</code><br>
<em>
string
</em>
</td>
<td>
<p>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:</p>
<ul>
<li><code>access-key</code>: The access-key/account/username for object storage authentication.</li>
<li><code>secret-key</code>: The secret-key/password for object storage authentication.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3 id="fleet.kurator.dev/v1alpha1.BackupStorageLocation">BackupStorageLocation
</h3>
<p>
(<em>Appears on:</em>
<a href="#fleet.kurator.dev/v1alpha1.BackupStorage">BackupStorage</a>)
</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>bucket</code><br>
<em>
string
</em>
</td>
<td>
<p>Bucket specifies the storage bucket name.</p>
</td>
</tr>
<tr>
<td>
<code>provider</code><br>
<em>
string
</em>
</td>
<td>
<p>Provider specifies the storage provider type (e.g., aws, gcp, azure).</p>
</td>
</tr>
<tr>
<td>
<code>endpoint</code><br>
<em>
string
</em>
</td>
<td>
<p>Endpoint provides the endpoint URL for the storage.</p>
</td>
</tr>
<tr>
<td>
<code>region</code><br>
<em>
string
</em>
</td>
<td>
<p>Region specifies the region of the storage.</p>
</td>
</tr>
<tr>
<td>
<code>config</code><br>
<em>
map[string]string
</em>
</td>
<td>
<p>Config is a map for additional provider-specific configurations.</p>
</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 @@ -594,6 +792,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
78 changes: 78 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,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.
Expand Down
58 changes: 58 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,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.
Expand Down
Loading
Loading