v1alpha1

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 80

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the localstorage v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=hwameistor.io

Package v1alpha1 contains v1alpha1 API versions.

This file ensures Go source parsers acknowledge the v1alpha1 package and any child packages. It can be removed if any other Go source files are added to this package.

Package v1alpha1 contains API Schema definitions for the localstorage v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=hwameistor.io

Index

Constants

View Source
const (
	LocalStorage     = "local-storage"
	LocalDiskManager = "local-disk-manager"
	System           = "system"
)
View Source
const (
	VolumeCapability_AccessType_Block = "Block"
	VolumeCapability_AccessType_Mount = "Mount"
)
View Source
const (
	NodeStateReady    State = "Ready"
	NodeStateMaintain State = "Maintain"
	NodeStateOffline  State = "Offline"

	VolumeStateToBeUnmount State = "ToBeMounted"
	VolumeStateEmpty       State = ""
	VolumeStateCreated     State = "Created"
	VolumeStateCreating    State = "Creating"
	VolumeStateReady       State = "Ready"
	VolumeStateNotReady    State = "NotReady"
	VolumeStateToBeDeleted State = "ToBeDeleted"
	VolumeStateDeleted     State = "Deleted"

	VolumeReplicaStateInvalid     State = "Invalid"
	VolumeReplicaStateCreating    State = "Creating"
	VolumeReplicaStateReady       State = "Ready"
	VolumeReplicaStateNotReady    State = "NotReady"
	VolumeReplicaStateToBeDeleted State = "ToBeDeleted"
	VolumeReplicaStateDeleted     State = "Deleted"

	// ha replica state
	HAVolumeReplicaStateConsistent   State = "Consistent"
	HAVolumeReplicaStateInconsistent State = "Inconsistent"
	HAVolumeReplicaStateUp           State = "Up"
	HAVolumeReplicaStateDown         State = "Down"

	// purpose of the following CRDs is for operational job,
	// so, they will be in different state machine from volume/volumereplica
	OperationStateSubmitted           State = "Submitted"
	OperationStateMigrateAddReplica   State = "AddReplica"
	OperationStateMigrateSyncReplica  State = "SyncReplica"
	OperationStateMigratePruneReplica State = "PruneReplica"
	OperationStateInProgress          State = "InProgress"
	OperationStateCompleted           State = "Completed"
	OperationStateToBeAborted         State = "ToBeAborted"
	OperationStateAborting            State = "Cancelled"
	OperationStateAborted             State = "Aborted"
	OperationStateFailed              State = "Failed"

	DiskStateAvailable State = "Available"
	DiskStateInUse     State = "InUse"
	DiskStateOffline   State = "Offline"

	LVMVolumeMaxCount int64 = 1000
	RAMVolumeMaxCount int64 = 1000

	VolumeKindLVM = "LVM"

	VolumeExpansionCapacityBytesMin int64 = 10 * 1024 * 1024 // 10MiB

	StoragePoolCapacityThresholdRatio = 0.85

	VolumeMigratePhaseMove  Phase = "Move"
	VolumeMigratePhasePrune Phase = "Prune"
)

states

View Source
const (
	DiskClassNameHDD  = "HDD"
	DiskClassNameSSD  = "SSD"
	DiskClassNameNVMe = "NVMe"
)

disk class

View Source
const (
	PoolNamePrefix  = "LocalStorage_Pool"
	PoolNameForHDD  = PoolNamePrefix + DiskClassNameHDD
	PoolNameForSSD  = PoolNamePrefix + DiskClassNameSSD
	PoolNameForNVMe = PoolNamePrefix + DiskClassNameNVMe

	PoolTypeRegular = "REGULAR"
)

consts

View Source
const (
	VolumeParameterPoolClassKey     = "poolClass"
	VolumeParameterPoolTypeKey      = "poolType"
	VolumeParameterReplicaNumberKey = "replicaNumber"
	VolumeParameterFSTypeKey        = "csi.storage.k8s.io/fstype"
	VolumeParameterConvertible      = "convertible"
	VolumeParameterThroughput       = "provision-throughput-on-creation"
	VolumeParameterIOPS             = "provision-iops-on-creation"
)

consts

View Source
const (
	CSIDriverName = "lvm.hwameistor.io"

	VendorName = "hwameistor.io"
)

misc

View Source
const (
	DiskDevRootPath     = "/dev"
	AssigedDiskPool     = DiskDevRootPath + "/LocalStorage_DiskPool"
	AssigedDiskPoolHDD  = AssigedDiskPool + DiskClassNameHDD
	AssigedDiskPoolSSD  = AssigedDiskPool + DiskClassNameSSD
	AssigedDiskPoolNVMe = AssigedDiskPool + DiskClassNameNVMe
)

localstorage local storage dev paths

View Source
const (
	StorageIPv4AddressAnnotationKeyEnv = "NODE_ANNOTATION_KEY_STORAGE_IPV4"
)

k8snode

View Source
const (
	// Can only be published once as read/write on a single node, at
	// any given time.
	VolumeCapability_AccessMode_SINGLE_NODE_WRITER = csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "hwameistor.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme for Local Storage Member
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
)
View Source
var AddToSchemes runtime.SchemeBuilder

AddToSchemes may be used to add all resources defined in the project to a Scheme for Local Storage Member

Functions

func AddToScheme

func AddToScheme(s *runtime.Scheme) error

AddToScheme adds all Resources to the Scheme for Local Storage Member

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AccessibilityTopology

type AccessibilityTopology struct {
	// Nodes is the collection of storage nodes the volume replicas must locate at
	Nodes []string `json:"nodes,omitempty"`

	// zones where the volume replicas should be distributed across, it's Optional
	// +kubebuilder:default:={default}
	Zones []string `json:"zones,omitempty"`

	// regions where the volume replicas should be distributed across, it's Optional
	// +kubebuilder:default:={default}
	Regions []string `json:"regions,omitempty"`
}

AccessibilityTopology of the volume

func (*AccessibilityTopology) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessibilityTopology.

func (*AccessibilityTopology) DeepCopyInto

func (in *AccessibilityTopology) DeepCopyInto(out *AccessibilityTopology)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConditionStatus

type ConditionStatus string
const (
	ConditionTrue    ConditionStatus = "True"
	ConditionFalse   ConditionStatus = "False"
	ConditionUnknown ConditionStatus = "Unknown"
)

These are valid condition statuses. "ConditionTrue" means a resource is in the condition. "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes can't decide if a resource is in the condition or not. In the future, we could add other intermediate conditions, e.g. ConditionDegraded.

type DRBDSystemConfig

type DRBDSystemConfig struct {
	StartPort int `json:"haStartPort"`
	EndPort   int `json:"haEndPort"`
}

DRBDSystemConfig of HA module

func (*DRBDSystemConfig) DeepCopy

func (in *DRBDSystemConfig) DeepCopy() *DRBDSystemConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DRBDSystemConfig.

func (*DRBDSystemConfig) DeepCopyInto

func (in *DRBDSystemConfig) DeepCopyInto(out *DRBDSystemConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Disk

type Disk struct {
	// DevPath
	DevPath string `json:"devPath"`

	// Capacity
	Capacity int64 `json:"capacity,omitempty"`

	// DiskType SSD/HDD/NVME...
	DiskType string `json:"diskType"`

	// Status
	Status string `json:"status"`
}

func (*Disk) DeepCopy

func (in *Disk) DeepCopy() *Disk

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Disk.

func (*Disk) DeepCopyInto

func (in *Disk) DeepCopyInto(out *Disk)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DiskAttributes

type DiskAttributes struct {
	// Type is the disk type, such as ata, scsi, nvme, megaraid,N, ...
	Type string `json:"type,omitempty"`

	// DeviceType represents the type of device like
	// sparse, disk, partition, lvm, crypt
	DevType string `json:"devType,omitempty"`

	// Vendor is who provides the disk
	Vendor string `json:"vendor,omitempty"`

	// Product is a class of disks the vendor produces
	Product string `json:"product,omitempty"`

	// PCIVendorID is the ID of the PCI vendor, for NVMe disk only
	PCIVendorID string `json:"pciVendorID,omitempty"`

	// ModelName is the name of disk model
	ModelName string `json:"modelName,omitempty"`

	// SerialNumber is a unique number assigned to a disk
	SerialNumber string `json:"serialNumber,omitempty"`

	// FormFactor is the disk size, like 2.5 inches
	FormFactor string `json:"formFactor,omitempty"`

	// RotationRate is the rate of the disk rotation
	RotationRate int64 `json:"rotationRate,omitempty"`

	// Protocol is for data transport, such as ATA, SCSI, NVMe
	Protocol string `json:"protocol,omitempty"`
}

DiskAttributes represent certain hardware/static attributes of the disk

func (*DiskAttributes) DeepCopy

func (in *DiskAttributes) DeepCopy() *DiskAttributes

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskAttributes.

func (*DiskAttributes) DeepCopyInto

func (in *DiskAttributes) DeepCopyInto(out *DiskAttributes)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DiskClaimDescription

type DiskClaimDescription struct {
	// DiskType represents the type of drive like SSD, HDD etc.,
	// +optional
	DiskType string `json:"diskType,omitempty"`

	// Capacity of the disk in bytes
	Capacity int64 `json:"capacity,omitempty"`
}

DiskClaimDescription defines the details of the disk that should be claimed

func (*DiskClaimDescription) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskClaimDescription.

func (*DiskClaimDescription) DeepCopyInto

func (in *DiskClaimDescription) DeepCopyInto(out *DiskClaimDescription)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DiskClaimStatus

type DiskClaimStatus string

DiskClaimStatus is a typed string for phase field of BlockDeviceClaim.

const (
	// LocalDiskClaimStatusEmpty represents that the LocalDiskClaim was just created.
	DiskClaimStatusEmpty DiskClaimStatus = ""

	// LocalDiskClaimStatusPending represents LocalDiskClaim has not been assigned devices yet. Rather
	// search is going on for matching disks.
	LocalDiskClaimStatusPending DiskClaimStatus = "Pending"

	// LocalDiskClaimStatusExtending represents LocalDiskClaim has been assigned devices yet, but need more disks.
	// Rather search is going on for matching disks.
	LocalDiskClaimStatusExtending DiskClaimStatus = "Extending"

	// LocalDiskClaimStatusBound represents LocalDiskClaim has been assigned backing disk and ready for use.
	LocalDiskClaimStatusBound DiskClaimStatus = "Bound"

	// LocalDiskClaimStatusConsumed represents disks backing this LocalDiskClaim is consumed by the consumer
	LocalDiskClaimStatusConsumed DiskClaimStatus = "Consumed"

	// LocalDiskClaimStatusToBeDeleted represents disks backing this LocalDiskClaim is consumed already and the claim
	// will be deleted after some clean job done
	LocalDiskClaimStatusToBeDeleted DiskClaimStatus = "ToBeDeleted"

	// LocalDiskClaimStatusDeleted  represents disks backing this LocalDiskClaim can be deleted
	LocalDiskClaimStatusDeleted DiskClaimStatus = "Deleted"
)

LocalDiskClaim CR, when created pass through phases before it got some Disks Assigned.

type FileSystemInfo

type FileSystemInfo struct {
	// Type represents the FileSystem type of the disk
	// +optional
	Type string `json:"fsType,omitempty"`

	// MountPoint represents the mountpoint of the disk
	// +optional
	Mountpoint string `json:"mountPoint,omitempty"`
}

FileSystemInfo defines the filesystem type and mountpoint of the disk if it exists

func (*FileSystemInfo) DeepCopy

func (in *FileSystemInfo) DeepCopy() *FileSystemInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileSystemInfo.

func (*FileSystemInfo) DeepCopyInto

func (in *FileSystemInfo) DeepCopyInto(out *FileSystemInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HAState

type HAState struct {
	// Consistent, Inconsistent, replica is ready only when consistent
	State State `json:"state"`
	// Reason is why this state happened
	Reason string `json:"reason,omitempty"`
}

HAState is state for ha replica

func (*HAState) DeepCopy

func (in *HAState) DeepCopy() *HAState

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HAState.

func (*HAState) DeepCopyInto

func (in *HAState) DeepCopyInto(out *HAState)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalDevice

type LocalDevice struct {
	// e.g. /dev/sdb
	DevPath string `json:"devPath,omitempty"`

	// Supported: HDD, SSD, NVMe, RAM
	Class string `json:"type,omitempty"`

	// disk capacity
	CapacityBytes int64 `json:"capacityBytes,omitempty"`

	// Possible state: Available, Inuse, Offline
	State State `json:"state,omitempty"`
}

LocalDevice is disk struct

func (*LocalDevice) DeepCopy

func (in *LocalDevice) DeepCopy() *LocalDevice

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDevice.

func (*LocalDevice) DeepCopyInto

func (in *LocalDevice) DeepCopyInto(out *LocalDevice)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalDisk

type LocalDisk struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalDiskSpec   `json:"spec,omitempty"`
	Status LocalDiskStatus `json:"status,omitempty"`
}

LocalDisk is the Schema for the localdisks API +kubebuilder:resource:scope=Cluster,shortName=ld +kubebuilder:subresource:status +kubebuilder:printcolumn:JSONPath=".spec.nodeName",name=NodeMatch,type=string +kubebuilder:printcolumn:JSONPath=".spec.owner",name=Owner,type=string,priority=1 +kubebuilder:printcolumn:JSONPath=".status.claimState",name=Phase,type=string +kubebuilder:printcolumn:JSONPath=".spec.smartInfo.overallHealth",name=Health,type=string,priority=1 +kubebuilder:printcolumn:JSONPath=".spec.reserved",name=Reserved,type=boolean,priority=1

func (*LocalDisk) DeepCopy

func (in *LocalDisk) DeepCopy() *LocalDisk

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDisk.

func (*LocalDisk) DeepCopyInto

func (in *LocalDisk) DeepCopyInto(out *LocalDisk)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalDisk) DeepCopyObject

func (in *LocalDisk) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalDiskClaim

type LocalDiskClaim struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalDiskClaimSpec   `json:"spec,omitempty"`
	Status LocalDiskClaimStatus `json:"status,omitempty"`
}

LocalDiskClaim is the Schema for the localdiskclaims API +kubebuilder:validation:Required +kubebuilder:subresource:status +kubebuilder:printcolumn:JSONPath=".spec.nodeName",name=NodeMatch,type=string +kubebuilder:printcolumn:JSONPath=".status.status",name=Phase,type=string +kubebuilder:printcolumn:JSONPath=".spec.owner",name=Owner,type=string +kubebuilder:resource:scope=Cluster,shortName=ldc

func (*LocalDiskClaim) DeepCopy

func (in *LocalDiskClaim) DeepCopy() *LocalDiskClaim

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskClaim.

func (*LocalDiskClaim) DeepCopyInto

func (in *LocalDiskClaim) DeepCopyInto(out *LocalDiskClaim)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalDiskClaim) DeepCopyObject

func (in *LocalDiskClaim) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalDiskClaimEventReason added in v0.6.0

type LocalDiskClaimEventReason = string
const (
	LocalDiskClaimEventReasonBound      LocalDiskClaimEventReason = "LocalDiskClaimBound"
	LocalDiskClaimEventReasonBoundFail  LocalDiskClaimEventReason = "LocalDiskClaimBoundFail"
	LocalDiskClaimEventReasonAssignFail LocalDiskClaimEventReason = "LocalDiskClaimAssignFail"
	LocalDiskClaimEventReasonExtend     LocalDiskClaimEventReason = "LocalDiskClaimExtend"
)

type LocalDiskClaimList

type LocalDiskClaimList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalDiskClaim `json:"items"`
}

LocalDiskClaimList contains a list of LocalDiskClaim

func (*LocalDiskClaimList) DeepCopy

func (in *LocalDiskClaimList) DeepCopy() *LocalDiskClaimList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskClaimList.

func (*LocalDiskClaimList) DeepCopyInto

func (in *LocalDiskClaimList) DeepCopyInto(out *LocalDiskClaimList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalDiskClaimList) DeepCopyObject

func (in *LocalDiskClaimList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalDiskClaimSpec

type LocalDiskClaimSpec struct {
	// +kubebuilder:validation:Required
	// NodeName represents where disk has to be claimed.
	NodeName string `json:"nodeName"`

	// Description of the disk to be claimed
	// +optional
	Description DiskClaimDescription `json:"description,omitempty"`

	// DiskRefs represents which disks are assigned to the LocalDiskClaim
	// +optional
	DiskRefs []*v1.ObjectReference `json:"diskRefs,omitempty"`

	// Owner represents which system owns this claim(e.g. local-storage, local-disk-manager)
	Owner string `json:"owner,omitempty"`
}

LocalDiskClaimSpec defines the desired state of LocalDiskClaim

func (*LocalDiskClaimSpec) DeepCopy

func (in *LocalDiskClaimSpec) DeepCopy() *LocalDiskClaimSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskClaimSpec.

func (*LocalDiskClaimSpec) DeepCopyInto

func (in *LocalDiskClaimSpec) DeepCopyInto(out *LocalDiskClaimSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalDiskClaimSpecArray added in v0.8.0

type LocalDiskClaimSpecArray []LocalDiskClaimSpec

func (LocalDiskClaimSpecArray) DeepCopy added in v0.8.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskClaimSpecArray.

func (LocalDiskClaimSpecArray) DeepCopyInto added in v0.8.0

func (in LocalDiskClaimSpecArray) DeepCopyInto(out *LocalDiskClaimSpecArray)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalDiskClaimState

type LocalDiskClaimState string

LocalDiskClaimState defines the observed state of LocalDisk

const (
	// LocalDiskUnclaimed represents that the disk is not bound to any LDC,
	// and is available for claiming.
	LocalDiskUnclaimed LocalDiskClaimState = "Available"

	// LocalDiskReleased represents that the disk is released from the LDC,
	LocalDiskReleased LocalDiskClaimState = "Released"

	// LocalDiskClaimed represents that the disk is bound to a LDC
	LocalDiskClaimed LocalDiskClaimState = "Claimed"

	// LocalDiskInUse represents that the disk is in use but not claimed by a LDC
	LocalDiskInUse LocalDiskClaimState = "Inuse"
)

type LocalDiskClaimStatus

type LocalDiskClaimStatus struct {
	// Status represents the current statue of the claim
	// +kubebuilder:validation:Enum:=Bound;Pending;Extending;Consumed;ToBeDeleted;Deleted
	Status DiskClaimStatus `json:"status,omitempty"`
}

LocalDiskClaimStatus defines the observed state of LocalDiskClaim

func (*LocalDiskClaimStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskClaimStatus.

func (*LocalDiskClaimStatus) DeepCopyInto

func (in *LocalDiskClaimStatus) DeepCopyInto(out *LocalDiskClaimStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalDiskEventReason added in v0.6.0

type LocalDiskEventReason = string
const (
	LocalDiskEventReasonAvailable     LocalDiskEventReason = "LocalDiskAvailable"
	LocalDiskEventReasonAvailableFail LocalDiskEventReason = "LocalDiskAvailableFail"
	LocalDiskEventReasonRelease       LocalDiskEventReason = "LocalDiskRelease"
	LocalDiskEventReasonReleaseFail   LocalDiskEventReason = "LocalDiskReleaseFail"
	LocalDiskEventReasonBound         LocalDiskEventReason = "LocalDiskBound"
	LocalDiskEventReasonBoundFail     LocalDiskEventReason = "LocalDiskBoundFail"
	LocalDiskEventReasonReserved      LocalDiskEventReason = "LocalDiskReserved"
	LocalDiskEventReasonReservedFail  LocalDiskEventReason = "LocalDiskReservedFail"
	LocalDiskEventReasonPending       LocalDiskEventReason = "LocalDiskPending"
	LocalDiskEventReasonPendingFail   LocalDiskEventReason = "LocalDiskPendingFail"
)

type LocalDiskList

type LocalDiskList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalDisk `json:"items"`
}

LocalDiskList contains a list of LocalDisk

func (*LocalDiskList) DeepCopy

func (in *LocalDiskList) DeepCopy() *LocalDiskList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskList.

func (*LocalDiskList) DeepCopyInto

func (in *LocalDiskList) DeepCopyInto(out *LocalDiskList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalDiskList) DeepCopyObject

func (in *LocalDiskList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalDiskNode

type LocalDiskNode struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalDiskNodeSpec   `json:"spec,omitempty"`
	Status LocalDiskNodeStatus `json:"status,omitempty"`
}

LocalDiskNode is the Schema for the localdisknodes API +kubebuilder:subresource:status +kubebuilder:resource:path=localdisknodes,scope=Cluster,shortName=ldn +kubebuilder:printcolumn:JSONPath=".status.freeCapacity",name=FreeCapacity,type=integer +kubebuilder:printcolumn:JSONPath=".status.totalCapacity",name=TotalCapacity,type=integer +kubebuilder:printcolumn:JSONPath=".status.totalDisk",name=TotalDisk,type=integer +kubebuilder:printcolumn:name="status",type=string,JSONPath=`.status.state`,description="State of the LocalDisk Node" +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*LocalDiskNode) DeepCopy

func (in *LocalDiskNode) DeepCopy() *LocalDiskNode

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskNode.

func (*LocalDiskNode) DeepCopyInto

func (in *LocalDiskNode) DeepCopyInto(out *LocalDiskNode)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalDiskNode) DeepCopyObject

func (in *LocalDiskNode) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalDiskNodeList

type LocalDiskNodeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalDiskNode `json:"items"`
}

LocalDiskNodeList contains a list of LocalDiskNode

func (*LocalDiskNodeList) DeepCopy

func (in *LocalDiskNodeList) DeepCopy() *LocalDiskNodeList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskNodeList.

func (*LocalDiskNodeList) DeepCopyInto

func (in *LocalDiskNodeList) DeepCopyInto(out *LocalDiskNodeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalDiskNodeList) DeepCopyObject

func (in *LocalDiskNodeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalDiskNodeSpec

type LocalDiskNodeSpec struct {
	// NodeName represent where disk is attached
	NodeName string `json:"nodeName"`
}

LocalDiskNodeSpec defines the desired state of LocalDiskNode

func (*LocalDiskNodeSpec) DeepCopy

func (in *LocalDiskNodeSpec) DeepCopy() *LocalDiskNodeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskNodeSpec.

func (*LocalDiskNodeSpec) DeepCopyInto

func (in *LocalDiskNodeSpec) DeepCopyInto(out *LocalDiskNodeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalDiskNodeStatus

type LocalDiskNodeStatus struct {
	// There may have multiple storage pools in a node.
	// e.g. HDD_POOL, SSD_POOL, NVMe_POOL
	// Pools: poolName -> LocalPool
	Pools map[string]LocalPool `json:"pools,omitempty"`

	// State of the Local Storage Node/Member: New, Active, Inactive, Failed
	State State `json:"state,omitempty"`

	// Represents the latest available observations of a localstoragenode's current state.
	// +optional
	Conditions []StorageNodeCondition `json:"conditions,omitempty"`

	// PoolExtendRecords record why disks are joined in the pool
	// +optional
	PoolExtendRecords map[string]LocalDiskClaimSpecArray `json:"poolExtendRecords,omitempty"`

	// TotalDisk
	TotalDisk int64 `json:"totalDisk,omitempty"`

	// FreeDisk
	FreeDisk int64 `json:"freeDisk,omitempty"`

	// TotalCapacity indicates the capacity of all the disks
	TotalCapacity int64 `json:"totalCapacity,omitempty"`

	// FreeCapacity indicates the free capacity of all the disks
	FreeCapacity int64 `json:"freeCapacity,omitempty"`
}

LocalDiskNodeStatus defines the observed state of LocalDiskNode

func (*LocalDiskNodeStatus) DeepCopy

func (in *LocalDiskNodeStatus) DeepCopy() *LocalDiskNodeStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskNodeStatus.

func (*LocalDiskNodeStatus) DeepCopyInto

func (in *LocalDiskNodeStatus) DeepCopyInto(out *LocalDiskNodeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalDiskSpec

type LocalDiskSpec struct {
	// NodeName represents the node where the disk is attached
	// +kubebuilder:validation:Required
	NodeName string `json:"nodeName"`

	// UUID global unique identifier of the disk
	UUID string `json:"uuid,omitempty"`

	// DevicePath is the disk path in the OS
	DevicePath string `json:"devicePath,omitempty"`

	// Capacity of the disk in bytes
	Capacity int64 `json:"capacity,omitempty"`

	// HasPartition represents if the disk has partitions or not
	HasPartition bool `json:"partitioned,omitempty"`

	// PartitionInfo contains partition information
	// +optional
	PartitionInfo []PartitionInfo `json:"partitionInfo,omitempty"`

	// HasRAID identifies if the disk is a raid disk or not
	HasRAID bool `json:"isRaid,omitempty"`

	// RAIDInfo contains RAID information
	// +optional
	RAIDInfo RAIDInfo `json:"raidInfo,omitempty"`

	// HasSmartInfo identified if the disk supports SMART or not
	HasSmartInfo bool `json:"supportSmart,omitempty"`

	// SmartInfo contains infos collected by smartctl
	// +optional
	SmartInfo SmartInfo `json:"smartInfo,omitempty"`

	// DiskAttributes has hardware/static attributes of the disk
	DiskAttributes DiskAttributes `json:"diskAttributes,omitempty"`

	// State is the current state of the disk (Active/Inactive/Unknown)
	// +kubebuilder:validation:Enum:=Active;Inactive;Unknown
	State LocalDiskState `json:"state,omitempty"`

	// ClaimRef is the reference to the LDC which has claimed this LD
	// +optional
	ClaimRef *v1.ObjectReference `json:"claimRef,omitempty"`

	// Reserved represents the disk won't be used in hwameistor later, until it becomes unreserved
	// +optional
	Reserved bool `json:"reserved,omitempty"`

	// Owner represents which system owns this claim(e.g. local-storage, local-disk-manager)
	// +optional
	Owner string `json:"owner,omitempty"`
}

LocalDiskSpec defines the desired state of LocalDisk

func (*LocalDiskSpec) DeepCopy

func (in *LocalDiskSpec) DeepCopy() *LocalDiskSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskSpec.

func (*LocalDiskSpec) DeepCopyInto

func (in *LocalDiskSpec) DeepCopyInto(out *LocalDiskSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalDiskState

type LocalDiskState string

LocalDiskState defines the observed state of the local disk

const (
	// LocalDiskActive is the state for the disk that is connected
	LocalDiskActive LocalDiskState = "Active"

	// LocalDiskInactive is the state for the disk that is disconnected
	LocalDiskInactive LocalDiskState = "Inactive"

	// LocalDiskUnknown is the state for the disk that cannot be determined
	// at this time(whether attached or detached)
	LocalDiskUnknown LocalDiskState = "Unknown"
)

NOTE: The follow-up state represent disk health status detected by system or health check tools(e.g., smartctl)

const (
	// LocalDiskEmpty is temporary status, it can be updated to Available or Bound
	LocalDiskEmpty LocalDiskState = ""

	// LocalDiskPending is temporary status, it can be updated to Available or Bound
	LocalDiskPending LocalDiskState = "Pending"

	// LocalDiskAvailable represents the disk can be used which means:
	// 1) there is no filesystem or partitions exist
	// 2) the disk is not bound to any LocalDiskClaim object
	LocalDiskAvailable LocalDiskState = "Available"

	// LocalDiskBound represents the disk is used already.
	// There are follow-up use cases:
	// 1) used by system (e.g., rootfs)
	// 2) used by a LocalDiskClaim object
	// 3) there is already a filesystem or partition exist
	LocalDiskBound LocalDiskState = "Bound"
)

NOTE: The follow-up state represent LocalDisk instance status

type LocalDiskStatus

type LocalDiskStatus struct {
	// State represents the claim state of the disk
	// +kubebuilder:validation:Enum:=Bound;Reserved;Available;Pending
	State LocalDiskState `json:"claimState,omitempty"`
}

LocalDiskStatus defines the observed state of LocalDisk

func (*LocalDiskStatus) DeepCopy

func (in *LocalDiskStatus) DeepCopy() *LocalDiskStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskStatus.

func (*LocalDiskStatus) DeepCopyInto

func (in *LocalDiskStatus) DeepCopyInto(out *LocalDiskStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalDiskVolume

type LocalDiskVolume struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalDiskVolumeSpec   `json:"spec,omitempty"`
	Status LocalDiskVolumeStatus `json:"status,omitempty"`
}

LocalDiskVolume is the Schema for the localdiskvolumes API +kubebuilder:resource:path=localdiskvolumes,scope=Cluster,shortName=ldv +kubebuilder:printcolumn:JSONPath=".spec.accessibility.nodes[0]",name=Node,type=string +kubebuilder:printcolumn:JSONPath=".status.devPath",name=Disk,type=string +kubebuilder:printcolumn:JSONPath=".status.allocatedCapacityBytes",name=AllocatedCap,type=integer +kubebuilder:printcolumn:JSONPath=".spec.diskType",name=Type,type=string +kubebuilder:printcolumn:JSONPath=".status.state",name=Status,type=string

func (*LocalDiskVolume) DeepCopy

func (in *LocalDiskVolume) DeepCopy() *LocalDiskVolume

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskVolume.

func (*LocalDiskVolume) DeepCopyInto

func (in *LocalDiskVolume) DeepCopyInto(out *LocalDiskVolume)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalDiskVolume) DeepCopyObject

func (in *LocalDiskVolume) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalDiskVolumeList

type LocalDiskVolumeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalDiskVolume `json:"items"`
}

LocalDiskVolumeList contains a list of LocalDiskVolume

func (*LocalDiskVolumeList) DeepCopy

func (in *LocalDiskVolumeList) DeepCopy() *LocalDiskVolumeList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskVolumeList.

func (*LocalDiskVolumeList) DeepCopyInto

func (in *LocalDiskVolumeList) DeepCopyInto(out *LocalDiskVolumeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalDiskVolumeList) DeepCopyObject

func (in *LocalDiskVolumeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalDiskVolumeSpec

type LocalDiskVolumeSpec struct {
	// DiskType represents the type of drive like SSD, HDD etc.,
	DiskType string `json:"diskType"`

	// RequiredCapacityBytes
	RequiredCapacityBytes int64 `json:"requiredCapacityBytes,omitempty"`

	// Accessibility is the topology requirement of the volume. It describes how to locate and distribute the volume replicas
	Accessibility AccessibilityTopology `json:"accessibility,omitempty"`

	// PersistentVolumeClaimName is the reference of the associated PVC
	PersistentVolumeClaimName string `json:"persistentVolumeClaimName,omitempty"`

	// CanWipe represents if disk can wipe after Volume is deleted
	// If disk has been writen data, this is will be changed to true
	CanWipe bool `json:"canWipe,omitempty"`
}

LocalDiskVolumeSpec defines the desired state of LocalDiskVolume

func (*LocalDiskVolumeSpec) DeepCopy

func (in *LocalDiskVolumeSpec) DeepCopy() *LocalDiskVolumeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskVolumeSpec.

func (*LocalDiskVolumeSpec) DeepCopyInto

func (in *LocalDiskVolumeSpec) DeepCopyInto(out *LocalDiskVolumeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalDiskVolumeStatus

type LocalDiskVolumeStatus struct {
	// LocalDiskName is disk name which is used to create this volume
	LocalDiskName string `json:"localDiskName,omitempty"`

	// DevPath is the disk path in the OS
	DevPath string `json:"devPath"`

	// AllocatedCapacityBytes is the real allocated capacity in bytes
	AllocatedCapacityBytes int64 `json:"allocatedCapacityBytes,omitempty"`

	// UsedCapacityBytes is the real used capacity in bytes
	UsedCapacityBytes int64 `json:"usedCapacityBytes,omitempty"`

	// MountPoints
	MountPoints []MountPoint `json:"mountPoints,omitempty"`

	// State is the phase of volume replica, e.g. Creating, Ready, NotReady, ToBeDeleted, Deleted
	State State `json:"state,omitempty"`
}

LocalDiskVolumeStatus defines the observed state of LocalDiskVolume

func (*LocalDiskVolumeStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalDiskVolumeStatus.

func (*LocalDiskVolumeStatus) DeepCopyInto

func (in *LocalDiskVolumeStatus) DeepCopyInto(out *LocalDiskVolumeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalPool

type LocalPool struct {
	// Supported pool name: HDD_POOL, SSD_POOL, NVMe_POOL
	Name string `json:"name,omitempty"`

	// Supported class: HDD, SSD, NVMe
	// +kubebuilder:validation:Enum:=HDD;SSD;NVMe
	Class string `json:"class"`

	// Supported type: REGULAR
	// +kubebuilder:validation:Enum:=REGULAR
	// +kubebuilder:default:=REGULAR
	Type string `json:"type"`

	// VG path
	Path string `json:"path,omitempty"`

	TotalCapacityBytes int64 `json:"totalCapacityBytes"`

	UsedCapacityBytes int64 `json:"usedCapacityBytes"`

	VolumeCapacityBytesLimit int64 `json:"volumeCapacityBytesLimit"`

	FreeCapacityBytes int64 `json:"freeCapacityBytes"`

	TotalVolumeCount int64 `json:"totalVolumeCount"`

	UsedVolumeCount int64 `json:"usedVolumeCount"`

	FreeVolumeCount int64 `json:"freeVolumeCount"`

	Disks []LocalDevice `json:"disks,omitempty"`

	Volumes []string `json:"volumes,omitempty"`
}

LocalPool is storage pool struct

func (*LocalPool) DeepCopy

func (in *LocalPool) DeepCopy() *LocalPool

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalPool.

func (*LocalPool) DeepCopyInto

func (in *LocalPool) DeepCopyInto(out *LocalPool)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalStorageNode

type LocalStorageNode struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalStorageNodeSpec   `json:"spec,omitempty"`
	Status LocalStorageNodeStatus `json:"status,omitempty"`
}

LocalStorageNode is the Schema for the localstoragenodes API +kubebuilder:subresource:status +kubebuilder:resource:path=localstoragenodes,scope=Cluster,shortName=lsn +kubebuilder:printcolumn:name="ip",type=string,JSONPath=`.spec.storageIP`,description="IPv4 address" +kubebuilder:printcolumn:name="status",type=string,JSONPath=`.status.state`,description="State of the Local Storage Node" +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*LocalStorageNode) DeepCopy

func (in *LocalStorageNode) DeepCopy() *LocalStorageNode

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalStorageNode.

func (*LocalStorageNode) DeepCopyInto

func (in *LocalStorageNode) DeepCopyInto(out *LocalStorageNode)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalStorageNode) DeepCopyObject

func (in *LocalStorageNode) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalStorageNodeList

type LocalStorageNodeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalStorageNode `json:"items"`
}

LocalStorageNodeList contains a list of LocalStorageNode

func (*LocalStorageNodeList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalStorageNodeList.

func (*LocalStorageNodeList) DeepCopyInto

func (in *LocalStorageNodeList) DeepCopyInto(out *LocalStorageNodeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalStorageNodeList) DeepCopyObject

func (in *LocalStorageNodeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalStorageNodeSpec

type LocalStorageNodeSpec struct {
	HostName string `json:"hostname,omitempty"`

	// IPv4 address is for HA replication traffic
	StorageIP string `json:"storageIP,omitempty"`

	Topo Topology `json:"topogoly,omitempty"`
}

LocalStorageNodeSpec defines the desired state of LocalStorageNode

func (*LocalStorageNodeSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalStorageNodeSpec.

func (*LocalStorageNodeSpec) DeepCopyInto

func (in *LocalStorageNodeSpec) DeepCopyInto(out *LocalStorageNodeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalStorageNodeStatus

type LocalStorageNodeStatus struct {

	// There may have multiple storage pools in a node.
	// e.g. HDD_POOL, SSD_POOL, NVMe_POOL
	// Pools: poolName -> LocalPool
	Pools map[string]LocalPool `json:"pools,omitempty"`

	// State of the Local Storage Node/Member: New, Active, Inactive, Failed
	State State `json:"state,omitempty"`

	// Represents the latest available observations of a localstoragenode's current state.
	// +optional
	Conditions []StorageNodeCondition `json:"conditions,omitempty"`

	// PoolExtendRecords record why disks are joined in the pool
	// +optional
	PoolExtendRecords map[string]LocalDiskClaimSpecArray `json:"poolExtendRecords,omitempty"`
}

LocalStorageNodeStatus defines the observed state of LocalStorageNode

func (*LocalStorageNodeStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalStorageNodeStatus.

func (*LocalStorageNodeStatus) DeepCopyInto

func (in *LocalStorageNodeStatus) DeepCopyInto(out *LocalStorageNodeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolume

type LocalVolume struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalVolumeSpec   `json:"spec,omitempty"`
	Status LocalVolumeStatus `json:"status,omitempty"`
}

LocalVolume is the Schema for the volumes API +kubebuilder:subresource:status +kubebuilder:resource:path=localvolumes,scope=Cluster,shortName=lv +kubebuilder:printcolumn:name="pool",type=string,JSONPath=`.spec.poolName`,description="Name of storage pool" +kubebuilder:printcolumn:name="replicas",type=integer,JSONPath=`.spec.replicaNumber`,description="Number of volume replica" +kubebuilder:printcolumn:name="capacity",type=integer,JSONPath=`.spec.requiredCapacityBytes`,description="Required capacity of the volume" +kubebuilder:printcolumn:name="used",type=integer,JSONPath=`.status.usedCapacityBytes`,description="Used capacity of the volume" +kubebuilder:printcolumn:name="state",type=string,JSONPath=`.status.state`,description="State of the volume" +kubebuilder:printcolumn:name="resource",type=integer,JSONPath=`.spec.config.resourceID`,description="Allocated resource ID for the volume" +kubebuilder:printcolumn:name="published",type=string,JSONPath=`.status.publishedNode`,description="Name of the node where the volume is in-use" +kubebuilder:printcolumn:name="fstype",type=string,JSONPath=`.status.fsType`,description="Filesystem type of this volume" +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*LocalVolume) DeepCopy

func (in *LocalVolume) DeepCopy() *LocalVolume

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolume.

func (*LocalVolume) DeepCopyInto

func (in *LocalVolume) DeepCopyInto(out *LocalVolume)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolume) DeepCopyObject

func (in *LocalVolume) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*LocalVolume) IsHighAvailability

func (v *LocalVolume) IsHighAvailability() bool

IsHighAvailability return true if volume is HighAvailability

func (*LocalVolume) SetReplicas

func (v *LocalVolume) SetReplicas(replicas []*LocalVolumeReplica)

SetReplicas add replicas into status

type LocalVolumeConvert

type LocalVolumeConvert struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalVolumeConvertSpec   `json:"spec,omitempty"`
	Status LocalVolumeConvertStatus `json:"status,omitempty"`
}

LocalVolumeConvert is the Schema for the localvolumeconverts API +kubebuilder:subresource:status +kubebuilder:resource:path=localvolumeconverts,scope=Cluster,shortName=lvconvert +kubebuilder:printcolumn:name="volume",type=string,JSONPath=`.spec.volumeName`,description="Name of the volume to convert" +kubebuilder:printcolumn:name="replicas",type=integer,JSONPath=`.spec.replicaNumber`,description="Number of volume replica" +kubebuilder:printcolumn:name="state",type=string,JSONPath=`.status.state`,description="State of the expansion" +kubebuilder:printcolumn:name="message",type=string,JSONPath=`.status.message`,description="Event message of the expansion" +kubebuilder:printcolumn:name="abort",type=boolean,JSONPath=`.spec.abort`,description="Abort the operation" +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*LocalVolumeConvert) DeepCopy

func (in *LocalVolumeConvert) DeepCopy() *LocalVolumeConvert

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeConvert.

func (*LocalVolumeConvert) DeepCopyInto

func (in *LocalVolumeConvert) DeepCopyInto(out *LocalVolumeConvert)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeConvert) DeepCopyObject

func (in *LocalVolumeConvert) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalVolumeConvertList

type LocalVolumeConvertList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalVolumeConvert `json:"items"`
}

LocalVolumeConvertList contains a list of LocalVolumeConvert

func (*LocalVolumeConvertList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeConvertList.

func (*LocalVolumeConvertList) DeepCopyInto

func (in *LocalVolumeConvertList) DeepCopyInto(out *LocalVolumeConvertList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeConvertList) DeepCopyObject

func (in *LocalVolumeConvertList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalVolumeConvertSpec

type LocalVolumeConvertSpec struct {
	VolumeName string `json:"volumeName,omitempty"`

	// ReplicaNumber is the number of replicas which the volume will be converted to
	// currently, only support the case of converting a non-HA volume to HA
	// +kubebuilder:validation:Minimum:=2
	// +kubebuilder:validation:Maximum:=2
	ReplicaNumber int64 `json:"replicaNumber,omitempty"`

	// +kubebuilder:default:=false
	Abort bool `json:"abort,omitempty"`
}

LocalVolumeConvertSpec defines the desired state of LocalVolumeConvert

func (*LocalVolumeConvertSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeConvertSpec.

func (*LocalVolumeConvertSpec) DeepCopyInto

func (in *LocalVolumeConvertSpec) DeepCopyInto(out *LocalVolumeConvertSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeConvertStatus

type LocalVolumeConvertStatus struct {
	State State `json:"state,omitempty"`

	Message string `json:"message,omitempty"`
}

LocalVolumeConvertStatus defines the observed state of LocalVolumeConvert

func (*LocalVolumeConvertStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeConvertStatus.

func (*LocalVolumeConvertStatus) DeepCopyInto

func (in *LocalVolumeConvertStatus) DeepCopyInto(out *LocalVolumeConvertStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeExpand

type LocalVolumeExpand struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalVolumeExpandSpec   `json:"spec,omitempty"`
	Status LocalVolumeExpandStatus `json:"status,omitempty"`
}

LocalVolumeExpand is the Schema for the localvolumeexpands API +kubebuilder:subresource:status +kubebuilder:resource:path=localvolumeexpands,scope=Cluster,shortName=lvexpand +kubebuilder:printcolumn:name="newCapacity",type=integer,JSONPath=`.spec.requiredCapacityBytes`,description="New capacity of the volume" +kubebuilder:printcolumn:name="abort",type=boolean,JSONPath=`.spec.abort`,description="Abort the operation" +kubebuilder:printcolumn:name="state",type=string,JSONPath=`.status.state`,description="State of the expansion" +kubebuilder:printcolumn:name="subs",type=string,JSONPath=`.status.subs`,description="Sub-operations on each volume replica expansion" +kubebuilder:printcolumn:name="message",type=string,JSONPath=`.status.message`,description="Event message of the expansion" +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*LocalVolumeExpand) AddSubs

func (v *LocalVolumeExpand) AddSubs(subNames ...string)

AddSubs updates with subs info

func (*LocalVolumeExpand) DeepCopy

func (in *LocalVolumeExpand) DeepCopy() *LocalVolumeExpand

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeExpand.

func (*LocalVolumeExpand) DeepCopyInto

func (in *LocalVolumeExpand) DeepCopyInto(out *LocalVolumeExpand)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeExpand) DeepCopyObject

func (in *LocalVolumeExpand) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*LocalVolumeExpand) HasSub

func (v *LocalVolumeExpand) HasSub(name string) bool

HasSub updates with sub-resource info

type LocalVolumeExpandList

type LocalVolumeExpandList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalVolumeExpand `json:"items"`
}

LocalVolumeExpandList contains a list of LocalVolumeExpand

func (*LocalVolumeExpandList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeExpandList.

func (*LocalVolumeExpandList) DeepCopyInto

func (in *LocalVolumeExpandList) DeepCopyInto(out *LocalVolumeExpandList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeExpandList) DeepCopyObject

func (in *LocalVolumeExpandList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalVolumeExpandSpec

type LocalVolumeExpandSpec struct {
	VolumeName string `json:"volumeName,omitempty"`

	// +kubebuilder:validation:Minimum:=4194304
	RequiredCapacityBytes int64 `json:"requiredCapacityBytes,omitempty"`

	// +kubebuilder:default:=false
	Abort bool `json:"abort,omitempty"`
}

LocalVolumeExpandSpec defines the desired state of LocalVolumeExpand

func (*LocalVolumeExpandSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeExpandSpec.

func (*LocalVolumeExpandSpec) DeepCopyInto

func (in *LocalVolumeExpandSpec) DeepCopyInto(out *LocalVolumeExpandSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeExpandStatus

type LocalVolumeExpandStatus struct {
	AllocatedCapacityBytes int64 `json:"allocatedCapacityBytes,omitempty"`

	// sub resources at different node.
	Subs []string `json:"subs,omitempty"`

	State State `json:"state,omitempty"`

	Message string `json:"message,omitempty"`
}

LocalVolumeExpandStatus defines the observed state of LocalVolumeExpand

func (*LocalVolumeExpandStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeExpandStatus.

func (*LocalVolumeExpandStatus) DeepCopyInto

func (in *LocalVolumeExpandStatus) DeepCopyInto(out *LocalVolumeExpandStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeGroup

type LocalVolumeGroup struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalVolumeGroupSpec   `json:"spec,omitempty"`
	Status LocalVolumeGroupStatus `json:"status,omitempty"`
}

LocalVolumeGroup is the Schema for the localvolumegroups API +kubebuilder:subresource:status +kubebuilder:resource:path=localvolumegroups,scope=Cluster,shortName=lvg +kubebuilder:printcolumn:name="pod",type=string,JSONPath=`.spec.pods`,description="Name of associated pod" +kubebuilder:printcolumn:name="namespace",type=string,JSONPath=`.spec.namespace`,description="Namespace of associated pod" +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*LocalVolumeGroup) DeepCopy

func (in *LocalVolumeGroup) DeepCopy() *LocalVolumeGroup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeGroup.

func (*LocalVolumeGroup) DeepCopyInto

func (in *LocalVolumeGroup) DeepCopyInto(out *LocalVolumeGroup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeGroup) DeepCopyObject

func (in *LocalVolumeGroup) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalVolumeGroupList

type LocalVolumeGroupList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalVolumeGroup `json:"items"`
}

LocalVolumeGroupList contains a list of LocalVolumeGroup

func (*LocalVolumeGroupList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeGroupList.

func (*LocalVolumeGroupList) DeepCopyInto

func (in *LocalVolumeGroupList) DeepCopyInto(out *LocalVolumeGroupList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeGroupList) DeepCopyObject

func (in *LocalVolumeGroupList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalVolumeGroupSpec

type LocalVolumeGroupSpec struct {

	// Volumes is the collection of the volumes in the group
	Volumes []VolumeInfo `json:"volumes,omitempty"`

	// Accessibility is the topology requirement of the volume. It describes how to locate and distribute the volume replicas
	Accessibility AccessibilityTopology `json:"accessibility,omitempty"`

	Pods []string `json:"pods,omitempty"`

	Namespace string `json:"namespace,omitempty"`
}

LocalVolumeGroupSpec defines the desired state of LocalVolumeGroup

func (*LocalVolumeGroupSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeGroupSpec.

func (*LocalVolumeGroupSpec) DeepCopyInto

func (in *LocalVolumeGroupSpec) DeepCopyInto(out *LocalVolumeGroupSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeGroupStatus

type LocalVolumeGroupStatus struct {
}

LocalVolumeGroupStatus defines the observed state of LocalVolumeGroup

func (*LocalVolumeGroupStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeGroupStatus.

func (*LocalVolumeGroupStatus) DeepCopyInto

func (in *LocalVolumeGroupStatus) DeepCopyInto(out *LocalVolumeGroupStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeList

type LocalVolumeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalVolume `json:"items"`
}

LocalVolumeList contains a list of LocalVolume

func (*LocalVolumeList) DeepCopy

func (in *LocalVolumeList) DeepCopy() *LocalVolumeList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeList.

func (*LocalVolumeList) DeepCopyInto

func (in *LocalVolumeList) DeepCopyInto(out *LocalVolumeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeList) DeepCopyObject

func (in *LocalVolumeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalVolumeMigrate

type LocalVolumeMigrate struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalVolumeMigrateSpec   `json:"spec,omitempty"`
	Status LocalVolumeMigrateStatus `json:"status,omitempty"`
}

LocalVolumeMigrate is the Schema for the localvolumemigrates API +kubebuilder:subresource:status +kubebuilder:resource:path=localvolumemigrates,scope=Cluster,shortName=lvmigrate +kubebuilder:printcolumn:name="volume",type=string,JSONPath=`.spec.volumeName`,description="Name of the volume to be migrated" +kubebuilder:printcolumn:name="from",type=string,JSONPath=`.spec.sourceNode`,description="Node name of the volume replica to be migrated" +kubebuilder:printcolumn:name="to",type=string,JSONPath=`.status.targetNode`,description="Node name of the new volume replica" +kubebuilder:printcolumn:name="state",type=string,JSONPath=`.status.state`,description="State of the migration" +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*LocalVolumeMigrate) DeepCopy

func (in *LocalVolumeMigrate) DeepCopy() *LocalVolumeMigrate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeMigrate.

func (*LocalVolumeMigrate) DeepCopyInto

func (in *LocalVolumeMigrate) DeepCopyInto(out *LocalVolumeMigrate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeMigrate) DeepCopyObject

func (in *LocalVolumeMigrate) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalVolumeMigrateList

type LocalVolumeMigrateList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalVolumeMigrate `json:"items"`
}

LocalVolumeMigrateList contains a list of LocalVolumeMigrate

func (*LocalVolumeMigrateList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeMigrateList.

func (*LocalVolumeMigrateList) DeepCopyInto

func (in *LocalVolumeMigrateList) DeepCopyInto(out *LocalVolumeMigrateList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeMigrateList) DeepCopyObject

func (in *LocalVolumeMigrateList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalVolumeMigrateSpec

type LocalVolumeMigrateSpec struct {
	VolumeName string `json:"volumeName"`

	// source NodeNames
	SourceNode string `json:"sourceNode"`

	// suggested target NodeNames
	TargetNodesSuggested []string `json:"targetNodesSuggested"`

	// +kubebuilder:default:=false
	MigrateAllVols bool `json:"migrateAllVols,omitempty"`

	// +kubebuilder:default:=false
	Abort bool `json:"abort,omitempty"`
}

LocalVolumeMigrateSpec defines the desired state of LocalVolumeMigrate

func (*LocalVolumeMigrateSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeMigrateSpec.

func (*LocalVolumeMigrateSpec) DeepCopyInto

func (in *LocalVolumeMigrateSpec) DeepCopyInto(out *LocalVolumeMigrateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeMigrateStatus

type LocalVolumeMigrateStatus struct {

	// record the volume's replica number, it will be set internally
	OriginalReplicaNumber int64 `json:"originalReplicaNumber,omitempty"`
	// record the node where the specified replica is migrated to
	TargetNode string `json:"targetNode,omitempty"`

	// State of the operation, e.g. submitted, started, completed, abort, ...
	State State `json:"state,omitempty"`
	// error message to describe some states
	Message string `json:"message,omitempty"`
}

LocalVolumeMigrateStatus defines the observed state of LocalVolumeMigrate

func (*LocalVolumeMigrateStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeMigrateStatus.

func (*LocalVolumeMigrateStatus) DeepCopyInto

func (in *LocalVolumeMigrateStatus) DeepCopyInto(out *LocalVolumeMigrateStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeReplica

type LocalVolumeReplica struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LocalVolumeReplicaSpec   `json:"spec,omitempty"`
	Status LocalVolumeReplicaStatus `json:"status,omitempty"`
}

LocalVolumeReplica is the Schema for the volumereplicas API +kubebuilder:subresource:status +kubebuilder:resource:path=localvolumereplicas,scope=Cluster,shortName=lvr +kubebuilder:printcolumn:name="capacity",type=integer,JSONPath=`.spec.requiredCapacityBytes`,description="Required capacity of the volume replica" +kubebuilder:printcolumn:name="node",type=string,JSONPath=`.spec.nodeName`,description="Node name where the volume replica is located at" +kubebuilder:printcolumn:name="state",type=string,JSONPath=`.status.state`,description="State of the volume replica" +kubebuilder:printcolumn:name="synced",type=boolean,JSONPath=`.status.synced`,description="Sync status of the volume replica" +kubebuilder:printcolumn:name="device",type=string,JSONPath=`.status.devPath`,description="Device path of the volume replica" +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*LocalVolumeReplica) DeepCopy

func (in *LocalVolumeReplica) DeepCopy() *LocalVolumeReplica

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplica.

func (*LocalVolumeReplica) DeepCopyInto

func (in *LocalVolumeReplica) DeepCopyInto(out *LocalVolumeReplica)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeReplica) DeepCopyObject

func (in *LocalVolumeReplica) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalVolumeReplicaList

type LocalVolumeReplicaList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LocalVolumeReplica `json:"items"`
}

LocalVolumeReplicaList contains a list of LocalVolumeReplica

func (*LocalVolumeReplicaList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaList.

func (*LocalVolumeReplicaList) DeepCopyInto

func (in *LocalVolumeReplicaList) DeepCopyInto(out *LocalVolumeReplicaList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LocalVolumeReplicaList) DeepCopyObject

func (in *LocalVolumeReplicaList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LocalVolumeReplicaSpec

type LocalVolumeReplicaSpec struct {

	// VolumeName is the name of the volume, e.g. pvc-fbf3ffc3-66db-4dae-9032-bda3c61b8f85
	VolumeName string `json:"volumeName,omitempty"`

	// PoolName is the name of the storage pool, e.g. LocalStorage_PoolHDD, LocalStorage_PoolSSD, etc..
	PoolName string `json:"poolName,omitempty"`

	// NodeName is the assigned node where the volume replica is located
	NodeName string `json:"nodeName,omitempty"`

	// +kubebuilder:validation:Minimum:=4194304
	RequiredCapacityBytes int64 `json:"requiredCapacityBytes,omitempty"`

	// VolumeQoS is the QoS of the volume
	VolumeQoS VolumeQoS `json:"volumeQoS,omitempty"`

	// Delete is to indicate where the replica should be deleted or not.
	// It's different from the regular resource delete interface in Kubernetes.
	// The purpose is to protect it from any mistakes
	// +kubebuilder:default:=false
	Delete bool `json:"delete,omitempty"`
}

LocalVolumeReplicaSpec defines the desired state of LocalVolumeReplica

func (*LocalVolumeReplicaSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaSpec.

func (*LocalVolumeReplicaSpec) DeepCopyInto

func (in *LocalVolumeReplicaSpec) DeepCopyInto(out *LocalVolumeReplicaSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeReplicaStatus

type LocalVolumeReplicaStatus struct {

	// StoragePath is a real path of the volume replica, like /dev/sdg.
	StoragePath string `json:"storagePath,omitempty"`

	// DevicePath is a link path of the StoragePath of the volume replica,
	// e.g. /dev/LocalStorage_PoolHDD/pvc-fbf3ffc3-66db-4dae-9032-bda3c61b8f85
	DevicePath string `json:"devPath,omitempty"`

	// Disks is a list of physical disks where the volume replica is spread cross, especially for striped LVM volume replica
	Disks []string `json:"disks,omitempty"`

	// AllocatedCapacityBytes is the real allocated capacity in bytes
	AllocatedCapacityBytes int64 `json:"allocatedCapacityBytes,omitempty"`

	// State is the phase of volume replica, e.g. Creating, Ready, NotReady, ToBeDeleted, Deleted
	State State `json:"state,omitempty"`

	// Synced is the sync state of the volume replica, which is important in HA volume
	// +kubebuilder:default:=false
	Synced bool `json:"synced,omitempty"`

	// HAState is state for ha replica, replica.Status.State == Ready only when HAState is Consistent of nil
	HAState *HAState `json:"haState,omitempty"`

	// InUse is one of volume replica's states, which indicates the replica is used by a Pod or not
	// +kubebuilder:default:=false
	InUse bool `json:"inuse,omitempty"`
}

LocalVolumeReplicaStatus defines the observed state of LocalVolumeReplica

func (*LocalVolumeReplicaStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaStatus.

func (*LocalVolumeReplicaStatus) DeepCopyInto

func (in *LocalVolumeReplicaStatus) DeepCopyInto(out *LocalVolumeReplicaStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeSpec

type LocalVolumeSpec struct {

	// +kubebuilder:validation:Minimum:=4194304
	RequiredCapacityBytes int64 `json:"requiredCapacityBytes,omitempty"`

	// VolumeQoS is the QoS of the volume
	VolumeQoS VolumeQoS `json:"volumeQoS,omitempty"`

	// PoolName is the name of the storage pool, e.g. LocalStorage_PoolHDD, LocalStorage_PoolSSD, etc..
	PoolName string `json:"poolName,omitempty"`

	// replica number: 1 - non-HA, 2 - HA, 4 - migration (temp)
	// +kubebuilder:validation:Minimum:=1
	// +kubebuilder:validation:Maximum:=4
	ReplicaNumber int64 `json:"replicaNumber,omitempty"`

	// Convertible is to indicate if the non-HA volume can be transitted to HA volume or not
	// +kubebuilder:default:=false
	Convertible bool `json:"convertible,omitempty"`

	// Accessibility is the topology requirement of the volume. It describes how to locate and distribute the volume replicas
	Accessibility AccessibilityTopology `json:"accessibility,omitempty"`

	// PersistentVolumeClaimNamespace is the namespace of the associated PVC
	PersistentVolumeClaimNamespace string `json:"pvcNamespace,omitempty"`

	// PersistentVolumeClaimName is the name of the associated PVC
	PersistentVolumeClaimName string `json:"pvcName,omitempty"`

	// VolumeGroup is the group name of the local volumes. It is designed for the scheduling and allocating.
	VolumeGroup string `json:"volumegroup,omitempty"`

	// Config is the configration for the volume replicas
	// It will be managed by the controller, and watched by all the nodes
	// Important: node will manage volume replica according this config
	Config *VolumeConfig `json:"config,omitempty"`

	// Delete is to indicate where the replica should be deleted or not.
	// It's different from the regular resource delete interface in Kubernetes.
	// The purpose is to protect it from any mistakes
	// +kubebuilder:default:=false
	Delete bool `json:"delete,omitempty"`
}

LocalVolumeSpec defines the desired state of LocalVolume

func (*LocalVolumeSpec) DeepCopy

func (in *LocalVolumeSpec) DeepCopy() *LocalVolumeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeSpec.

func (*LocalVolumeSpec) DeepCopyInto

func (in *LocalVolumeSpec) DeepCopyInto(out *LocalVolumeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalVolumeStatus

type LocalVolumeStatus struct {

	// AllocatedCapacityBytes is the real allocated capacity in bytes of the volume replicas.
	// In case of HA volume with multiple replicas, the value is equal to the one of a replica's size
	AllocatedCapacityBytes int64 `json:"allocatedCapacityBytes,omitempty"`

	// UsedCapacityBytes is the used capacity in bytes of the volume, which is available only for filesystem
	UsedCapacityBytes int64 `json:"usedCapacityBytes,omitempty"`

	// TotalINodes is the total inodes of the volume's filesystem
	TotalInodes int64 `json:"totalInode,omitempty"`

	// UsedInode is the used inodes of the volume's filesystem
	UsedInodes int64 `json:"usedInode,omitempty"`

	// Volume is a logical concept and composed by one or many replicas which will be located at different node.
	Replicas []string `json:"replicas,omitempty"`

	// State is the phase of volume replica, e.g. Creating, Ready, NotReady, ToBeDeleted, Deleted
	State State `json:"state,omitempty"`

	// PublishedNodeName is the node where the volume is published and used by pod
	PublishedNodeName string `json:"publishedNode,omitempty"`

	// PublishedFSType is the fstype on this volume
	PublishedFSType string `json:"fsType,omitempty"`

	// PublishedRawBlock is for raw block
	// +kubebuilder:default:=false
	PublishedRawBlock bool `json:"rawblock"`
}

LocalVolumeStatus defines the observed state of LocalVolume

func (*LocalVolumeStatus) DeepCopy

func (in *LocalVolumeStatus) DeepCopy() *LocalVolumeStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeStatus.

func (*LocalVolumeStatus) DeepCopyInto

func (in *LocalVolumeStatus) DeepCopyInto(out *LocalVolumeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MountPoint

type MountPoint struct {
	// TargetPath
	TargetPath string `json:"targetPath,omitempty"`

	// VolumeCap
	VolumeCap VolumeCapability `json:"volumeCap,omitempty"`

	// FsTye
	FsTye string `json:"fsTye,omitempty"`

	// MountOptions
	MountOptions []string `json:"mountOptions,omitempty"`

	// Phase indicates the volume's next or current operation
	Phase State `json:"phase,omitempty"`
}

MountPoint

func (*MountPoint) DeepCopy

func (in *MountPoint) DeepCopy() *MountPoint

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MountPoint.

func (*MountPoint) DeepCopyInto

func (in *MountPoint) DeepCopyInto(out *MountPoint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NodeConfig

type NodeConfig struct {
	Name      string    `json:"name,omitempty"`
	StorageIP string    `json:"ip,omitempty"`
	Topology  *Topology `json:"topology,omitempty"`
}

NodeConfig defines local storage system configurations

func (*NodeConfig) DeepCopy

func (in *NodeConfig) DeepCopy() *NodeConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeConfig.

func (*NodeConfig) DeepCopyInto

func (in *NodeConfig) DeepCopyInto(out *NodeConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PartitionInfo

type PartitionInfo struct {
	// Path represents the partition path in the OS
	Path string `json:"path"`

	// HasFileSystem represents whether the filesystem is included
	HasFileSystem bool `json:"hasFileSystem"`

	// FileSystem contains mount point and filesystem type
	// +optional
	FileSystem FileSystemInfo `json:"filesystem,omitempty"`
}

PartitionInfo contains partition information(e.g. FileSystem)

func (*PartitionInfo) DeepCopy

func (in *PartitionInfo) DeepCopy() *PartitionInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PartitionInfo.

func (*PartitionInfo) DeepCopyInto

func (in *PartitionInfo) DeepCopyInto(out *PartitionInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Phase

type Phase string

Phase is the phase of an operation

type RAIDInfo

type RAIDInfo struct {
	// RAIDMaster is the master of the RAID disk, it works for only RAID slave disk, e.g. /dev/bus/0
	RAIDMaster string `json:"raidMaster,omitempty"`
}

RAIDInfo contains infos of raid

func (*RAIDInfo) DeepCopy

func (in *RAIDInfo) DeepCopy() *RAIDInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RAIDInfo.

func (*RAIDInfo) DeepCopyInto

func (in *RAIDInfo) DeepCopyInto(out *RAIDInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SmartAssessResult

type SmartAssessResult string

SmartAssessResult defines the result of self-assessment test

const (
	// AssessPassed indicates the disk is healthy
	AssessPassed SmartAssessResult = "Passed"

	// AssessFailed indicates the disk is unhealthy
	AssessFailed SmartAssessResult = "Failed"
)

type SmartInfo

type SmartInfo struct {
	// OverallHealth identifies if the disk is healthy or not
	OverallHealth SmartAssessResult `json:"overallHealth"`
}

SmartInfo contains info collected by smartctl

func (*SmartInfo) DeepCopy

func (in *SmartInfo) DeepCopy() *SmartInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SmartInfo.

func (*SmartInfo) DeepCopyInto

func (in *SmartInfo) DeepCopyInto(out *SmartInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type State

type State string

State is state type of resources

const (
	// blow state is for mountpoint
	MountPointStateEmpty  State = ""
	MountPointToBeMounted State = "ToBeMounted"
	MountPointToBeUnMount State = "ToBeUnMount"
	MountPointMounted     State = "Mounted"
	MountPointNotReady    State = "NotReady"
)

type StorageNodeCondition added in v0.10.0

type StorageNodeCondition struct {
	// Type of localstoragenode condition.
	Type StorageNodeConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status ConditionStatus `json:"status"`
	// The last time this condition was updated.
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
	// Last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// The reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// A human-readable message indicating details about the transition.
	Message string `json:"message,omitempty"`
}

StorageNodeCondition describes the state of a localstoragenode at a certain point.

func (*StorageNodeCondition) DeepCopy added in v0.10.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageNodeCondition.

func (*StorageNodeCondition) DeepCopyInto added in v0.10.0

func (in *StorageNodeCondition) DeepCopyInto(out *StorageNodeCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StorageNodeConditionType added in v0.10.0

type StorageNodeConditionType string
const (
	// StorageAvailable Available means the storagenode is available, i.e. the free storage capacity is more than or equal 0
	StorageAvailable StorageNodeConditionType = "Available"
	// StorageUnAvailable UnAvailable means the storagenode is unavailable, i.e. the free storage capacity is less than or equal 0
	StorageUnAvailable StorageNodeConditionType = "UnAvailable"
	// StorageProgressing Progressing means the storagenode is progressing, i.e. extending storage capacity
	StorageProgressing StorageNodeConditionType = "Progressing"
	// StorageExpandFailure is added in a storagenode when a disk fails to be joined the storage pool
	StorageExpandFailure StorageNodeConditionType = "ExpandFailure"
	// StorageExpandSuccess is added in a storagenode when a disk succeeds to be joined the storage pool
	StorageExpandSuccess StorageNodeConditionType = "ExpandSuccess"
)

These are valid conditions of a storagenode.

type SystemConfig

type SystemConfig struct {
	Mode             SystemMode        `json:"mode"`
	DRBD             *DRBDSystemConfig `json:"drbd"`
	MaxHAVolumeCount int               `json:"maxVolumeCount"`
}

SystemConfig is volume HA related system configuration

func (*SystemConfig) DeepCopy

func (in *SystemConfig) DeepCopy() *SystemConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemConfig.

func (*SystemConfig) DeepCopyInto

func (in *SystemConfig) DeepCopyInto(out *SystemConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SystemMode

type SystemMode string

SystemMode of HA module

var (
	SystemModeDRBD SystemMode = "drbd"
)

misc

type Topology

type Topology struct {

	// Zone is a collection of Local Storage Nodes
	// +kubebuilder:default:=default
	Zone string `json:"zone,omitempty"`

	// Region is a collection of Zones
	// +kubebuilder:default:=default
	Region string `json:"region,omitempty"`
}

Topology defines the topology info of Node

func (*Topology) DeepCopy

func (in *Topology) DeepCopy() *Topology

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology.

func (*Topology) DeepCopyInto

func (in *Topology) DeepCopyInto(out *Topology)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VolumeAccessMode

type VolumeAccessMode int32

type VolumeAccessType

type VolumeAccessType string

type VolumeCapability

type VolumeCapability struct {
	AccessMode VolumeAccessMode `json:"accessMode,omitempty"`
	AccessType VolumeAccessType `json:"accessType,omitempty"`
}

func (*VolumeCapability) DeepCopy

func (in *VolumeCapability) DeepCopy() *VolumeCapability

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeCapability.

func (*VolumeCapability) DeepCopyInto

func (in *VolumeCapability) DeepCopyInto(out *VolumeCapability)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VolumeConfig

type VolumeConfig struct {
	// Version of config, start from 0, plus 1 every time config update
	Version               int    `json:"version"`
	VolumeName            string `json:"volumeName"`
	RequiredCapacityBytes int64  `json:"requiredCapacityBytes"`

	// Convertible is to indicate if the non-HA volume can be transitted to HA volume or not
	Convertible bool `json:"convertible"`

	// ResourceID is for HA volume, set to '-1' for non-HA volume
	ResourceID        int             `json:"resourceID"`
	ReadyToInitialize bool            `json:"readyToInitialize"`
	Initialized       bool            `json:"initialized"`
	Replicas          []VolumeReplica `json:"replicas"`
}

VolumeConfig is the configration of the volume, including the replicas

func (*VolumeConfig) DeepCopy

func (in *VolumeConfig) DeepCopy() *VolumeConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeConfig.

func (*VolumeConfig) DeepCopyInto

func (in *VolumeConfig) DeepCopyInto(out *VolumeConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VolumeConfig) DeepEqual

func (vc *VolumeConfig) DeepEqual(peer *VolumeConfig) bool

DeepEqual check if the two configs are equal completely or not

type VolumeGroupManager

type VolumeGroupManager interface {
	Init(stopCh <-chan struct{})
	ReconcileVolumeGroup(volGroup *LocalVolumeGroup)
	GetLocalVolumeGroupByName(lvgName string) (*LocalVolumeGroup, error)
	GetLocalVolumeGroupByLocalVolume(lvName string) (*LocalVolumeGroup, error)
	GetLocalVolumeGroupByPVC(pvcName string, pvcNamespace string) (*LocalVolumeGroup, error)
}

type VolumeInfo

type VolumeInfo struct {
	// LocalVolumeName is the name of the LocalVolume
	LocalVolumeName string `json:"localvolume,omitempty"`

	// PersistentVolumeClaimName is the name of the associated PVC
	PersistentVolumeClaimName string `json:"pvc,omitempty"`
}

func (*VolumeInfo) DeepCopy

func (in *VolumeInfo) DeepCopy() *VolumeInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeInfo.

func (*VolumeInfo) DeepCopyInto

func (in *VolumeInfo) DeepCopyInto(out *VolumeInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VolumeQoS added in v0.11.0

type VolumeQoS struct {
	// Throughput defines the throughput of the volume
	Throughput string `json:"throughput,omitempty"`
	// IOPS defines the IOPS of the volume
	IOPS string `json:"iops,omitempty"`
}

VolumeQoS is the QoS of the volume

func (*VolumeQoS) DeepCopy added in v0.11.0

func (in *VolumeQoS) DeepCopy() *VolumeQoS

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeQoS.

func (*VolumeQoS) DeepCopyInto added in v0.11.0

func (in *VolumeQoS) DeepCopyInto(out *VolumeQoS)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VolumeReplica

type VolumeReplica struct {
	ID       int    `json:"id"`
	Hostname string `json:"hostname"`
	IP       string `json:"ip"`
	Primary  bool   `json:"primary"`
}

VolumeReplica contains informations of replica peer

func (*VolumeReplica) DeepCopy

func (in *VolumeReplica) DeepCopy() *VolumeReplica

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeReplica.

func (*VolumeReplica) DeepCopyInto

func (in *VolumeReplica) DeepCopyInto(out *VolumeReplica)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VolumeReplica) DeepEqual

func (vr *VolumeReplica) DeepEqual(peer *VolumeReplica) bool

DeepEqual check if the two volumereplicas are equal completely or not

type VolumeScheduler

type VolumeScheduler interface {
	Init()
	// schedule will schedule all replicas, and generate a valid VolumeConfig
	Allocate(vol *LocalVolume) (*VolumeConfig, error)

	GetNodeCandidates(vols []*LocalVolume) []*LocalStorageNode

	ConfigureVolumeOnAdditionalNodes(vol *LocalVolume, nodes []*LocalStorageNode) (*VolumeConfig, error)
}

VolumeScheduler interface //go:generate mockgen -source=types.go -destination=../../../member/controller/scheduler/scheduler_mock.go -package=scheduler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL