Skip to content

Commit

Permalink
Unified Distributed Storage API implementation and go dependency pack…
Browse files Browse the repository at this point in the history
…age updates. Furthermore modified distributed proposal based on actual API implementation.

Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
  • Loading branch information
LiZhenCheng9527 committed Oct 20, 2023
1 parent 87ebcaa commit 6917a2e
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 105 deletions.
100 changes: 50 additions & 50 deletions docs/content/en/references/fleet_v1alpha1_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ <h3 id="fleet.kurator.dev/v1alpha1.ChartConfig">ChartConfig
<p>
(<em>Appears on:</em>
<a href="#fleet.kurator.dev/v1alpha1.BackupConfig">BackupConfig</a>,
<a href="#fleet.kurator.dev/v1alpha1.DistributedStroageConfig">DistributedStroageConfig</a>,
<a href="#fleet.kurator.dev/v1alpha1.DistributedStorageConfig">DistributedStorageConfig</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 @@ -399,7 +399,7 @@ <h3 id="fleet.kurator.dev/v1alpha1.DistributedStorage">DistributedStorage
</h3>
<p>
(<em>Appears on:</em>
<a href="#fleet.kurator.dev/v1alpha1.DistributedStroageConfig">DistributedStroageConfig</a>)
<a href="#fleet.kurator.dev/v1alpha1.DistributedStorageConfig">DistributedStorageConfig</a>)
</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table td-content">
Expand Down Expand Up @@ -475,7 +475,7 @@ <h3 id="fleet.kurator.dev/v1alpha1.DistributedStorage">DistributedStorage
</table>
</div>
</div>
<h3 id="fleet.kurator.dev/v1alpha1.DistributedStroageConfig">DistributedStroageConfig
<h3 id="fleet.kurator.dev/v1alpha1.DistributedStorageConfig">DistributedStorageConfig
</h3>
<p>
(<em>Appears on:</em>
Expand Down Expand Up @@ -1052,16 +1052,16 @@ <h3 id="fleet.kurator.dev/v1alpha1.Node">Node
</tr>
<tr>
<td>
<code>StroageDeviceSelection</code><br>
<code>StorageDeviceSelection</code><br>
<em>
<a href="#fleet.kurator.dev/v1alpha1.StroageDeviceSelection">
StroageDeviceSelection
<a href="#fleet.kurator.dev/v1alpha1.StorageDeviceSelection">
StorageDeviceSelection
</a>
</em>
</td>
<td>
<p>
(Members of <code>StroageDeviceSelection</code> are embedded into this type.)
(Members of <code>StorageDeviceSelection</code> are embedded into this type.)
</p>
<em>(Optional)</em>
<p>Specify which storage drives the osd deployed in this node can manage.</p>
Expand Down Expand Up @@ -1175,15 +1175,15 @@ <h3 id="fleet.kurator.dev/v1alpha1.PluginConfig">PluginConfig
</tr>
<tr>
<td>
<code>distributedStroage</code><br>
<code>distributedStorage</code><br>
<em>
<a href="#fleet.kurator.dev/v1alpha1.DistributedStroageConfig">
DistributedStroageConfig
<a href="#fleet.kurator.dev/v1alpha1.DistributedStorageConfig">
DistributedStorageConfig
</a>
</em>
</td>
<td>
<p>DistributedStroage define the configuration for the distributed stroage(Implemented with Rook)</p>
<p>DistributedStorage define the configuration for the distributed storage(Implemented with Rook)</p>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -1399,11 +1399,12 @@ <h3 id="fleet.kurator.dev/v1alpha1.PrometheusExporterConfig">PrometheusExporterC
</table>
</div>
</div>
<h3 id="fleet.kurator.dev/v1alpha1.StorageScopeSpec">StorageScopeSpec
<h3 id="fleet.kurator.dev/v1alpha1.StorageDeviceSelection">StorageDeviceSelection
</h3>
<p>
(<em>Appears on:</em>
<a href="#fleet.kurator.dev/v1alpha1.DistributedStorage">DistributedStorage</a>)
<a href="#fleet.kurator.dev/v1alpha1.Node">Node</a>,
<a href="#fleet.kurator.dev/v1alpha1.StorageScopeSpec">StorageScopeSpec</a>)
</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table td-content">
Expand All @@ -1417,56 +1418,41 @@ <h3 id="fleet.kurator.dev/v1alpha1.StorageScopeSpec">StorageScopeSpec
<tbody>
<tr>
<td>
<code>nodes</code><br>
<em>
<a href="#fleet.kurator.dev/v1alpha1.Node">
[]Node
</a>
</em>
</td>
<td>
<em>(Optional)</em>
</td>
</tr>
<tr>
<td>
<code>useAllNodes</code><br>
<code>useAllDevices</code><br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>indicating if all nodes in the cluster should be used for storage according to the cluster level storage selection and configuration values.
If individual nodes are specified under the nodes field, then useAllNodes must be set to false.</p>
<p>Whether to consume all the storage devices found on a machine
indicating whether all devices found on nodes in the cluster should be automatically consumed by OSDs.
Not recommended unless you have a very controlled environment where you will not risk formatting of devices with existing data.</p>
</td>
</tr>
<tr>
<td>
<code>StroageDeviceSelection</code><br>
<code>devices</code><br>
<em>
<a href="#fleet.kurator.dev/v1alpha1.StroageDeviceSelection">
StroageDeviceSelection
</a>
[]github.com/rook/rook/pkg/apis/ceph.rook.io/v1.Device
</em>
</td>
<td>
<p>
(Members of <code>StroageDeviceSelection</code> are embedded into this type.)
</p>
<p>Select device information used by osd. For more information see the design of the selection below.</p>
<em>(Optional)</em>
<p>List of devices to use as storage devices
A list of individual device names belonging to this node to include in the storage cluster
e.g. <code>sda</code> or <code>/dev/disk/by-id/ata-XXXX</code></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3 id="fleet.kurator.dev/v1alpha1.StroageDeviceSelection">StroageDeviceSelection
<h3 id="fleet.kurator.dev/v1alpha1.StorageScopeSpec">StorageScopeSpec
</h3>
<p>
(<em>Appears on:</em>
<a href="#fleet.kurator.dev/v1alpha1.Node">Node</a>,
<a href="#fleet.kurator.dev/v1alpha1.StorageScopeSpec">StorageScopeSpec</a>)
<a href="#fleet.kurator.dev/v1alpha1.DistributedStorage">DistributedStorage</a>)
</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table td-content">
Expand All @@ -1480,30 +1466,44 @@ <h3 id="fleet.kurator.dev/v1alpha1.StroageDeviceSelection">StroageDeviceSelectio
<tbody>
<tr>
<td>
<code>useAllDevices</code><br>
<code>nodes</code><br>
<em>
bool
<a href="#fleet.kurator.dev/v1alpha1.Node">
[]Node
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Whether to consume all the storage devices found on a machine
indicating whether all devices found on nodes in the cluster should be automatically consumed by OSDs.
Not recommended unless you have a very controlled environment where you will not risk formatting of devices with existing data.</p>
</td>
</tr>
<tr>
<td>
<code>devices</code><br>
<code>useAllNodes</code><br>
<em>
[]github.com/rook/rook/pkg/apis/ceph.rook.io/v1.Device
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>List of devices to use as storage devices
A list of individual device names belonging to this node to include in the storage cluster
e.g. <code>sda</code> or <code>/dev/disk/by-id/ata-XXXX</code></p>
<p>indicating if all nodes in the cluster should be used for storage according to the cluster level storage selection and configuration values.
If individual nodes are specified under the nodes field, then useAllNodes must be set to false.</p>
</td>
</tr>
<tr>
<td>
<code>StorageDeviceSelection</code><br>
<em>
<a href="#fleet.kurator.dev/v1alpha1.StorageDeviceSelection">
StorageDeviceSelection
</a>
</em>
</td>
<td>
<p>
(Members of <code>StorageDeviceSelection</code> are embedded into this type.)
</p>
<p>Select device information used by osd. For more information see the design of the selection below.</p>
</td>
</tr>
</tbody>
Expand Down
22 changes: 11 additions & 11 deletions docs/proposals/distributedstorage/distributedstorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,18 @@ type PluginConfig struct {
Policy *PolicyConfig `json:"policy,omitempty"`
// Backup defines the configuration for the backup engine(Velero).
Backup *BackupConfig `json:"backup,omitempty"`
// DistributedStroage define the configuration for the distributed stroage(Implemented with Rook)
DistributedStroage *DistributedStroageConfig `json:"distributedStroage,omitempty"`
// DistributedStorage define the configuration for the distributed storage(Implemented with Rook)
DistributedStorage *DistributedStorageConfig `json:"distributedStorage,omitempty"`
}

type DistributedStroageConfig struct {
type DistributedStorageConfig struct {
// Chart defines the helm chart configuration of the backup engine.
// The default value is:
//
// chart:
// repository: https://charts.rook.io/release
// name: rook
// version: 1.12.3
// version: 1.11.11
//
// +optional
Chart *ChartConfig `json:"chart,omitempty"`
Expand All @@ -208,26 +208,26 @@ type DistributedStorage struct {
// e.g. /var/lib/rook
// +kubebuilder:validation:Pattern=`^/(\S+)`
// +optional
DataDirHostPath string `json:"dataDirHostPath,omitempty"`
DataDirHostPath *string `json:"dataDirHostPath,omitempty"`

// Monitor is the daemon that monitors the status of the ceph cluster.
// Responsible for collecting cluster information, updating cluster information, and publishing cluster information.
// Including monmap, osdmap, PGmap, mdsmap, etc.
// A spec for mon related options
// +optional
// +nullable
Monitor MonSpec `json:"monitor,omitempty"`
Monitor *MonSpec `json:"monitor,omitempty"`

// Manager is the daemon runs alongside monitor daemon,to provide additional monitoring and interfaces to external monitoring and management systems.
// A spec for mgr related options
// +optional
// +nullable
Manager MgrSpec `json:"manager,omitempty"`
Manager *MgrSpec `json:"manager,omitempty"`

// A spec for available storage in the cluster and how it should be used
// +optional
// +nullable
Storage StorageScopeSpec `json:"storage,omitempty"`
Storage *StorageScopeSpec `json:"storage,omitempty"`
}
```

Expand Down Expand Up @@ -314,7 +314,7 @@ type StorageScopeSpec struct {
UseAllNodes bool `json:"useAllNodes,omitempty"`
// Select device information used by osd. For more information see the design of the selection below.
StroageDeviceSelection `json:",inline"`
StorageDeviceSelection `json:",inline"`

// OSDStore is the backend storage type used for creating the OSDs
// Default OSDStore type is bluestore which can directly manages bare devices
Expand All @@ -333,15 +333,15 @@ type Node struct {
// +kubebuilder:pruning:PreserveUnknownFields
// +nullable
// +optional
StroageDeviceSelection `json:",inline"`
StorageDeviceSelection `json:",inline"`
}

// This type of cluster can specify devices for OSDs, both at the cluster and individual node level, for selecting which storage resources will be included in the cluster.
// These selected devices do not mean that they need to be on all nodes, but osd will use them for storage.
// If these settings are not available, osd will also run on the specified nodes and listen for the status of the storage devices on the nodes.
// Once a specified device is plugged into a node, osd formats and plugs that device into osd for use.
// More info please refer to https://github.com/rook/rook/blob/master/Documentation/Getting-Started/quickstart.md#prerequisites
type StroageDeviceSelection struct {
type StorageDeviceSelection struct {
// Whether to consume all the storage devices found on a machine
// indicating whether all devices found on nodes in the cluster should be automatically consumed by OSDs.
//Not recommended unless you have a very controlled environment where you will not risk formatting of devices with existing data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ spec:
required:
- storage
type: object
distributedStroage:
description: DistributedStroage define the configuration for the
distributed stroage(Implemented with Rook)
distributedStorage:
description: DistributedStorage define the configuration for the
distributed storage(Implemented with Rook)
properties:
chart:
description: "Chart defines the helm chart configuration of
Expand Down
20 changes: 10 additions & 10 deletions pkg/apis/fleet/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ type PluginConfig struct {
Policy *PolicyConfig `json:"policy,omitempty"`
// Backup defines the configuration for the backup engine(Velero).
Backup *BackupConfig `json:"backup,omitempty"`
// DistributedStroage define the configuration for the distributed stroage(Implemented with Rook)
DistributedStroage *DistributedStroageConfig `json:"distributedStroage,omitempty"`
// DistributedStorage define the configuration for the distributed storage(Implemented with Rook)
DistributedStorage *DistributedStorageConfig `json:"distributedStorage,omitempty"`
}

type MetricConfig struct {
Expand Down Expand Up @@ -332,7 +332,7 @@ type BackupStorageLocation struct {
Config map[string]string `json:"config,omitempty"`
}

type DistributedStroageConfig struct {
type DistributedStorageConfig struct {
// Chart defines the helm chart configuration of the backup engine.
// The default value is:
//
Expand Down Expand Up @@ -364,26 +364,26 @@ type DistributedStorage struct {
// e.g. /var/lib/rook
// +kubebuilder:validation:Pattern=`^/(\S+)`
// +optional
DataDirHostPath string `json:"dataDirHostPath,omitempty"`
DataDirHostPath *string `json:"dataDirHostPath,omitempty"`

// Monitor is the daemon that monitors the status of the ceph cluster.
// Responsible for collecting cluster information, updating cluster information, and publishing cluster information.
// Including monmap, osdmap, PGmap, mdsmap, etc.
// A spec for mon related options
// +optional
// +nullable
Monitor MonSpec `json:"monitor,omitempty"`
Monitor *MonSpec `json:"monitor,omitempty"`

// Manager is the daemon runs alongside monitor daemon,to provide additional monitoring and interfaces to external monitoring and management systems.
// A spec for mgr related options
// +optional
// +nullable
Manager MgrSpec `json:"manager,omitempty"`
Manager *MgrSpec `json:"manager,omitempty"`

// A spec for available storage in the cluster and how it should be used
// +optional
// +nullable
Storage StorageScopeSpec `json:"storage,omitempty"`
Storage *StorageScopeSpec `json:"storage,omitempty"`
}

type MonSpec struct {
Expand Down Expand Up @@ -454,7 +454,7 @@ type StorageScopeSpec struct {
UseAllNodes bool `json:"useAllNodes,omitempty"`

// Select device information used by osd. For more information see the design of the selection below.
StroageDeviceSelection `json:",inline"`
StorageDeviceSelection `json:",inline"`
}

// Each individual node can specify configuration to override the cluster level settings and defaults.
Expand All @@ -468,10 +468,10 @@ type Node struct {
// +kubebuilder:pruning:PreserveUnknownFields
// +nullable
// +optional
StroageDeviceSelection `json:",inline"`
StorageDeviceSelection `json:",inline"`
}

type StroageDeviceSelection struct {
type StorageDeviceSelection struct {
// Whether to consume all the storage devices found on a machine
// indicating whether all devices found on nodes in the cluster should be automatically consumed by OSDs.
//Not recommended unless you have a very controlled environment where you will not risk formatting of devices with existing data.
Expand Down
Loading

0 comments on commit 6917a2e

Please sign in to comment.