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

OSDOCS-10556: Update descriptions for the API fields #627

Merged
merged 1 commit into from
May 15, 2024
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
40 changes: 16 additions & 24 deletions api/v1alpha1/lvmcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,24 @@ type LVMClusterSpec struct {
// Tolerations to apply to nodes to act on
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// Storage describes the deviceClass configuration for local storage devices
// Storage contains the device class configuration for local storage devices.
// +Optional
Storage Storage `json:"storage,omitempty"`
}

type ThinPoolConfig struct {
// Name of the thin pool to be created
// Name specifies a name for the thin pool.
// +kubebuilder:validation:Required
// +required
Name string `json:"name"`

// SizePercent represents percentage of remaining space in the volume group that should be used
// for creating the thin pool.
// SizePercent specifies the percentage of space in the LVM volume group for creating the thin pool.
// +kubebuilder:default=90
// +kubebuilder:validation:Minimum=10
// +kubebuilder:validation:Maximum=90
SizePercent int `json:"sizePercent,omitempty"`

// OverProvisionRatio is the factor by which additional storage can be provisioned compared to
// the available storage in the thin pool.
// OverProvisionRatio specifies a factor by which you can provision additional storage based on the available storage in the thin pool. To prevent over-provisioning through validation, set this field to 1.
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Required
// +required
Expand All @@ -62,31 +60,29 @@ const (
)

type DeviceClass struct {
// Name of the class, the VG and possibly the storageclass.
// Validations to confirm that this field can be used as metadata.name field in storageclass
// ref: https://github.com/kubernetes/apimachinery/blob/de7147/pkg/util/validation/validation.go#L209
// Name specifies a name for the device class
// +kubebuilder:validation:MaxLength=245
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
Name string `json:"name,omitempty"`

// DeviceSelector is a set of rules that should match for a device to be included in the LVMCluster
// DeviceSelector contains the configuration to specify paths to the devices that you want to add to the LVM volume group, and force wipe the selected devices.
// +optional
DeviceSelector *DeviceSelector `json:"deviceSelector,omitempty"`

// NodeSelector chooses nodes on which to create the deviceclass
// NodeSelector contains the configuration to choose the nodes on which you want to create the LVM volume group. If this field is not configured, all nodes without no-schedule taints are considered.
// +optional
NodeSelector *corev1.NodeSelector `json:"nodeSelector,omitempty"`

// ThinPoolConfig contains configurations for the thin-pool
// ThinPoolConfig contains the configuration to create a thin pool in the LVM volume group. If you exclude this field, logical volumes are thick provisioned.
// +optional
ThinPoolConfig *ThinPoolConfig `json:"thinPoolConfig,omitempty"`

// Default is a flag to indicate whether the device-class is the default
// Default is a flag to indicate that a device class is the default. You can configure only a single default device class.
// +optional
Default bool `json:"default,omitempty"`

// FilesystemType sets the filesystem the device should use
// FilesystemType sets the filesystem the device should use. Select either `ext4` or `xfs`.
// +kubebuilder:validation:Enum=xfs;ext4;""
// +kubebuilder:default=xfs
// +optional
Expand All @@ -99,21 +95,17 @@ type DeviceSelector struct {
// +optional
// MinSize *resource.Quantity `json:"minSize,omitempty"`

// A list of device paths which would be chosen for creating Volume Group.
// For example "/dev/disk/by-path/pci-0000:04:00.0-nvme-1"
// We discourage using the device names as they can change over node restarts.
// Paths specify the device paths.
// +optional
Paths []string `json:"paths,omitempty"`

// A list of device paths which could be chosen for creating Volume Group.
// For example "/dev/disk/by-path/pci-0000:04:00.0-nvme-1"
// We discourage using the device names as they can change over node restarts.
// OptionalPaths specify the optional device paths.
// +optional
OptionalPaths []string `json:"optionalPaths,omitempty"`

// ForceWipeDevicesAndDestroyAllData runs wipefs to wipe the devices.
// This can lead to data lose. Enable this only when you know that the disk
// does not contain any important data.
// ForceWipeDevicesAndDestroyAllData is a flag to force wipe the selected devices.
// This wipes the file signatures on the devices. Use this feature with caution.
// Force wipe the devices only when you know that they do not contain any important data.
// +optional
ForceWipeDevicesAndDestroyAllData *bool `json:"forceWipeDevicesAndDestroyAllData,omitempty"`
}
Expand Down Expand Up @@ -206,7 +198,7 @@ type DeviceClassStatus struct {
}

type Storage struct {
// DeviceClasses are a rules that assign local storage devices to volumegroups that are used for creating lvm based PVs
// DeviceClasses contains the configuration to assign the local storage devices to the LVM volume groups that you can use to provision persistent volume claims (PVCs).
// +Optional
DeviceClasses []DeviceClass `json:"deviceClasses,omitempty"`
}
Expand Down
71 changes: 35 additions & 36 deletions bundle/manifests/lvm.topolvm.io_lvmclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,67 +44,63 @@ spec:
description: LVMClusterSpec defines the desired state of LVMCluster
properties:
storage:
description: Storage describes the deviceClass configuration for local
storage devices
description: Storage contains the device class configuration for local
storage devices.
properties:
deviceClasses:
description: DeviceClasses are a rules that assign local storage
devices to volumegroups that are used for creating lvm based
PVs
description: DeviceClasses contains the configuration to assign
the local storage devices to the LVM volume groups that you
can use to provision persistent volume claims (PVCs).
items:
properties:
default:
description: Default is a flag to indicate whether the device-class
is the default
description: Default is a flag to indicate that a device
class is the default. You can configure only a single
default device class.
type: boolean
deviceSelector:
description: DeviceSelector is a set of rules that should
match for a device to be included in the LVMCluster
description: DeviceSelector contains the configuration to
specify paths to the devices that you want to add to the
LVM volume group, and force wipe the selected devices.
properties:
forceWipeDevicesAndDestroyAllData:
description: |-
ForceWipeDevicesAndDestroyAllData runs wipefs to wipe the devices.
This can lead to data lose. Enable this only when you know that the disk
does not contain any important data.
ForceWipeDevicesAndDestroyAllData is a flag to force wipe the selected devices.
This wipes the file signatures on the devices. Use this feature with caution.
Force wipe the devices only when you know that they do not contain any important data.
type: boolean
optionalPaths:
description: |-
A list of device paths which could be chosen for creating Volume Group.
For example "/dev/disk/by-path/pci-0000:04:00.0-nvme-1"
We discourage using the device names as they can change over node restarts.
description: OptionalPaths specify the optional device
paths.
items:
type: string
type: array
paths:
description: |-
A list of device paths which would be chosen for creating Volume Group.
For example "/dev/disk/by-path/pci-0000:04:00.0-nvme-1"
We discourage using the device names as they can change over node restarts.
description: Paths specify the device paths.
items:
type: string
type: array
type: object
fstype:
default: xfs
description: FilesystemType sets the filesystem the device
should use
should use. Select either `ext4` or `xfs`.
enum:
- xfs
- ext4
- ""
type: string
name:
description: |-
Name of the class, the VG and possibly the storageclass.
Validations to confirm that this field can be used as metadata.name field in storageclass
ref: https://github.com/kubernetes/apimachinery/blob/de7147/pkg/util/validation/validation.go#L209
description: Name specifies a name for the device class
maxLength: 245
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
nodeSelector:
description: NodeSelector chooses nodes on which to create
the deviceclass
description: NodeSelector contains the configuration to
choose the nodes on which you want to create the LVM volume
group. If this field is not configured, all nodes without
no-schedule taints are considered.
properties:
nodeSelectorTerms:
description: Required. A list of node selector terms.
Expand Down Expand Up @@ -187,23 +183,26 @@ spec:
type: object
x-kubernetes-map-type: atomic
thinPoolConfig:
description: ThinPoolConfig contains configurations for
the thin-pool
description: ThinPoolConfig contains the configuration to
create a thin pool in the LVM volume group. If you exclude
this field, logical volumes are thick provisioned.
properties:
name:
description: Name of the thin pool to be created
description: Name specifies a name for the thin pool.
type: string
overprovisionRatio:
description: |-
OverProvisionRatio is the factor by which additional storage can be provisioned compared to
the available storage in the thin pool.
description: OverProvisionRatio specifies a factor by
which you can provision additional storage based on
the available storage in the thin pool. To prevent
over-provisioning through validation, set this field
to 1.
minimum: 1
type: integer
sizePercent:
default: 90
description: |-
SizePercent represents percentage of remaining space in the volume group that should be used
for creating the thin pool.
description: SizePercent specifies the percentage of
space in the LVM volume group for creating the thin
pool.
maximum: 90
minimum: 10
type: integer
Expand Down
30 changes: 12 additions & 18 deletions bundle/manifests/lvm.topolvm.io_lvmvolumegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,17 @@ spec:
properties:
forceWipeDevicesAndDestroyAllData:
description: |-
ForceWipeDevicesAndDestroyAllData runs wipefs to wipe the devices.
This can lead to data lose. Enable this only when you know that the disk
does not contain any important data.
ForceWipeDevicesAndDestroyAllData is a flag to force wipe the selected devices.
This wipes the file signatures on the devices. Use this feature with caution.
Force wipe the devices only when you know that they do not contain any important data.
type: boolean
optionalPaths:
description: |-
A list of device paths which could be chosen for creating Volume Group.
For example "/dev/disk/by-path/pci-0000:04:00.0-nvme-1"
We discourage using the device names as they can change over node restarts.
description: OptionalPaths specify the optional device paths.
items:
type: string
type: array
paths:
description: |-
A list of device paths which would be chosen for creating Volume Group.
For example "/dev/disk/by-path/pci-0000:04:00.0-nvme-1"
We discourage using the device names as they can change over node restarts.
description: Paths specify the device paths.
items:
type: string
type: array
Expand Down Expand Up @@ -157,19 +151,19 @@ spec:
description: ThinPoolConfig contains configurations for the thin-pool
properties:
name:
description: Name of the thin pool to be created
description: Name specifies a name for the thin pool.
type: string
overprovisionRatio:
description: |-
OverProvisionRatio is the factor by which additional storage can be provisioned compared to
the available storage in the thin pool.
description: OverProvisionRatio specifies a factor by which you
can provision additional storage based on the available storage
in the thin pool. To prevent over-provisioning through validation,
set this field to 1.
minimum: 1
type: integer
sizePercent:
default: 90
description: |-
SizePercent represents percentage of remaining space in the volume group that should be used
for creating the thin pool.
description: SizePercent specifies the percentage of space in
the LVM volume group for creating the thin pool.
maximum: 90
minimum: 10
type: integer
Expand Down
Loading