v1alpha1

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

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

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

Index

Constants

View Source
const (
	NodeStateReady    State = "Ready"
	NodeStateMaintain State = "Maintain"
	NodeStateOffline  State = "Offline"

	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"
	OperationStateInProgress  State = "InProgress"
	OperationStateCompleted   State = "Completed"
	OperationStateToBeAborted State = "ToBeAborted"
	OperationStateAborting    State = "Cancelled"
	OperationStateAborted     State = "Aborted"

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

	LVMVolumeMaxCount int64 = 1000
	RAMVolumeMaxCount int64 = 1000

	VolumeKindDisk = "DISK"
	VolumeKindLVM  = "LVM"
	VolumeKindRAM  = "RAM"

	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"
	DiskClassNameRAM  = "RAM"
)

disk class

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

	PoolTypeRegular = "REGULAR"
)

consts

View Source
const (
	VolumeParameterPoolClassKey     = "poolClass"
	VolumeParameterPoolTypeKey      = "poolType"
	VolumeParameterVolumeKindKey    = "volumeKind"
	VolumeParameterReplicaNumberKey = "replicaNumber"
	VolumeParameterFSTypeKey        = "csi.storage.k8s.io/fstype"
	VolumeParameterStriped          = "striped"
	VolumeParameterConvertible      = "convertible"
)

consts

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

	VendorName = "hwameistor.io"
)

misc

View Source
const (
	LocalStorageConfigAnnotationName = "localstorage.hwameistor.io/local-storage-conf"

	StorageIPv4AddressAnnotationKeyEnv = "NODE_ANNOTATION_KEY_STORAGE_IPV4"
)

k8snode

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 (
	SmartCtlDeviceProtocolATA  = "ATA"
	SmartCtlDeviceProtocolSCSI = "SCSI"
	SmartCtlDeviceProtocolNVMe = "NVMe"

	SmartCtlDeviceProductVirtualDisk = "Virtual disk"
)

consts

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "localstorage.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 ATASmartHealthAttribute

type ATASmartHealthAttribute struct {
	ID         int64                           `json:"id"`
	Name       string                          `json:"name"`
	Value      int64                           `json:"value"`
	Worst      int64                           `json:"worst"`
	Threshold  int64                           `json:"thresh"`
	WhenFailed string                          `json:"when_failed"`
	Flags      *ATASmartHealthAttributeFlag    `json:"flags"`
	Raw        *ATASmartHealthAttributeRawData `json:"raw"`
}

ATASmartHealthAttribute struct

func (*ATASmartHealthAttribute) DeepCopy

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

func (*ATASmartHealthAttribute) DeepCopyInto

func (in *ATASmartHealthAttribute) DeepCopyInto(out *ATASmartHealthAttribute)

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

type ATASmartHealthAttributeFlag

type ATASmartHealthAttributeFlag struct {
	Value         int64  `json:"value"`
	String        string `json:"string"`
	Prefailure    bool   `json:"prefailure"`
	UpdatedOnline bool   `json:"updated_online"`
	Performance   bool   `json:"performance"`
	ErrorRate     bool   `json:"error_rate"`
	EventCount    bool   `json:"event_count"`
	AutoKeep      bool   `json:"auto_keep"`
}

ATASmartHealthAttributeFlag struct

func (*ATASmartHealthAttributeFlag) DeepCopy

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

func (*ATASmartHealthAttributeFlag) DeepCopyInto

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

type ATASmartHealthAttributeRawData

type ATASmartHealthAttributeRawData struct {
	Value  int64  `json:"value"`
	String string `json:"string"`
}

ATASmartHealthAttributeRawData struct

func (*ATASmartHealthAttributeRawData) DeepCopy

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

func (*ATASmartHealthAttributeRawData) DeepCopyInto

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

type ATASmartHealthDetailsInfo

type ATASmartHealthDetailsInfo struct {
	AttributesTable []ATASmartHealthAttribute `json:"table,omitempty"`
}

ATASmartHealthDetailsInfo struct

func (*ATASmartHealthDetailsInfo) DeepCopy

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

func (*ATASmartHealthDetailsInfo) DeepCopyInto

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

type AccessibilityTopology

type AccessibilityTopology struct {
	// One of the volume replica must be located at this node
	Node string `json:"node,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 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 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 LocalDisk

type LocalDisk 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"`
}

LocalDisk is disk struct

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.

type LocalPool

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

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

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

	// Supported volume kind: DISK, LVM, RAM
	// +kubebuilder:validation:Enum:=LVM;DISK;RAM
	// +kubebuilder:default:=LVM
	VolumeKind string `json:"volumeKind"`

	// 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 []LocalDisk `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 LocalStorageAlert

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

	Spec   LocalStorageAlertSpec   `json:"spec,omitempty"`
	Status LocalStorageAlertStatus `json:"status,omitempty"`
}

LocalStorageAlert is the Schema for the localstoragealerts API +kubebuilder:subresource:status +kubebuilder:resource:path=localstoragealerts,scope=Cluster,shortName=lsalert +kubebuilder:printcolumn:name="severity",type=integer,JSONPath=`.spec.severity`,description="Alert severity" +kubebuilder:printcolumn:name="module",type=string,JSONPath=`.spec.module`,description="Module of the alert" +kubebuilder:printcolumn:name="resource",type=string,JSONPath=`.spec.resource`,description="Resource name of the alert" +kubebuilder:printcolumn:name="event",type=string,JSONPath=`.spec.event`,description="Alert event"

func (*LocalStorageAlert) DeepCopy

func (in *LocalStorageAlert) DeepCopy() *LocalStorageAlert

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

func (*LocalStorageAlert) DeepCopyInto

func (in *LocalStorageAlert) DeepCopyInto(out *LocalStorageAlert)

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

func (*LocalStorageAlert) DeepCopyObject

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

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

type LocalStorageAlertList

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

LocalStorageAlertList contains a list of LocalStorageAlert

func (*LocalStorageAlertList) DeepCopy

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

func (*LocalStorageAlertList) DeepCopyInto

func (in *LocalStorageAlertList) DeepCopyInto(out *LocalStorageAlertList)

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

func (*LocalStorageAlertList) DeepCopyObject

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

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

type LocalStorageAlertSpec

type LocalStorageAlertSpec struct {
	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
	// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
	// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
	Severity int `json:"severity"`

	Module string `json:"module"`

	Resource string `json:"resource"`

	Event string `json:"event"`

	Details string `json:"details"`
}

LocalStorageAlertSpec defines the desired state of LocalStorageAlert

func (*LocalStorageAlertSpec) DeepCopy

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

func (*LocalStorageAlertSpec) DeepCopyInto

func (in *LocalStorageAlertSpec) DeepCopyInto(out *LocalStorageAlertSpec)

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

type LocalStorageAlertStatus

type LocalStorageAlertStatus struct {
}

LocalStorageAlertStatus defines the observed state of LocalStorageAlert

func (*LocalStorageAlertStatus) DeepCopy

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

func (*LocalStorageAlertStatus) DeepCopyInto

func (in *LocalStorageAlertStatus) DeepCopyInto(out *LocalStorageAlertStatus)

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

type LocalStorageConfig

type LocalStorageConfig struct {
	// +kubebuilder:validation:Enum:=LVM;DISK;RAM
	VolumeKind string `json:"volumeKind"`

	// +kubebuilder:default:=0
	RAMDiskTotalCapacity string `json:"ramdiskTotalCapacity,omitempty"`
}

LocalStorageConfig defines backend storage related configurations

func (*LocalStorageConfig) DeepCopy

func (in *LocalStorageConfig) DeepCopy() *LocalStorageConfig

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

func (*LocalStorageConfig) DeepCopyInto

func (in *LocalStorageConfig) DeepCopyInto(out *LocalStorageConfig)

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="volumekind",type=string,JSONPath=`.spec.allowedVolumeKind`,description="volume kind" +kubebuilder:printcolumn:name="ramdiskQuota",type=integer,JSONPath=`.spec.allowedRAMDiskTotalCapacityBytes`,description="total storage space of ramdisk" +kubebuilder:printcolumn:name="zone",type=string,JSONPath=`.spec.topogoly.zone`,description="Zone of the node" +kubebuilder:printcolumn:name="region",type=string,JSONPath=`.spec.topogoly.region`,description="Region of the node" +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"`

	// Supported volume kind: DISK, LVM, RAM
	// +kubebuilder:validation:Enum:=LVM;DISK;RAM
	AllowedVolumeKind string `json:"allowedVolumeKind"`

	// +kubebuilder:default:=0
	AllowdRAMDiskTotalCapacityBytes int64 `json:"allowedRAMDiskTotalCapacityBytes,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"`
}

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="kind",type=string,JSONPath=`.spec.kind`,description="Volume kind" +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="accessibility",type=string,JSONPath=`.spec.accessibility.node`,description="Accessibility of 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="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 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="node",type=string,JSONPath=`.spec.nodeName`,description="Node name of the volume replica to be migrated" +kubebuilder:printcolumn:name="target",type=string,JSONPath=`.status.targetNodeName`,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"`

	NodeName string `json:"nodeName"`

	// +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
	ReplicaNumber int64 `json:"replicaNumber,omitempty"`
	// record the node where the specified replica is migrated to
	TargetNodeName string `json:"targetNodeName,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="kind",type=string,JSONPath=`.spec.kind`,description="Volume kind" +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:Enum:=LVM;DISK;RAM
	// +kubebuilder:default:=LVM
	Kind string `json:"kind"`

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

	// Striped is to indecate if the volume should be stripped or not.
	// Stripped volume is for high performance, but with high risk of failure
	// Striped will take effect only for LVM volume
	// +kubebuilder:default:=false
	Striped bool `json:"striped,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"`

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

	// kind : LVM, DISK, RAM
	// +kubebuilder:validation:Enum:=LVM;DISK;RAM
	Kind string `json:"kind"`

	// replica number: 1 - non-HA, 2 - HA, 3 - migration (temp)
	// +kubebuilder:validation:Minimum:=1
	// +kubebuilder:validation:Maximum:=3
	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"`

	// Striped is to indicate if the volume should be stripped or not.
	// Stripped volume is for high performance, but with high risk of failure
	// Striped will take effect only for LVM volume
	// +kubebuilder:default:=false
	Striped bool `json:"striped,omitempty"`

	// Accessibility is the topology requirement of the volume. It describes how to locate and distribute the volume replicas
	Accessibility AccessibilityTopology `json:"accessibility,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"`

	// 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"`
}

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 NVMeSmartHealthDetailsInfo

type NVMeSmartHealthDetailsInfo struct {
	CriticalWarning         int64 `json:"critical_warning"`
	Temperature             int64 `json:"temperature"`
	AvailableSpare          int64 `json:"available_spare"`
	AvailableSpareThreshold int64 `json:"available_spare_threshold"`
	PercentageUsed          int64 `json:"percentage_used"`
	DataUnitsRead           int64 `json:"data_units_read"`
	DataUnitsWritten        int64 `json:"data_units_written"`
	HostReads               int64 `json:"host_reads"`
	HostWrites              int64 `json:"host_writes"`
	ControllerBusyTime      int64 `json:"controller_busy_time"`
	PowerCycles             int64 `json:"power_cycles"`
	PowerOnHours            int64 `json:"power_on_hours"`
	UnsafeShutdowns         int64 `json:"unsafe_shutdowns"`
	MediaErrors             int64 `json:"media_errors"`
	NumErrLogEntries        int64 `json:"num_err_log_entries"`
}

NVMeSmartHealthDetailsInfo struct

func (*NVMeSmartHealthDetailsInfo) DeepCopy

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

func (*NVMeSmartHealthDetailsInfo) DeepCopyInto

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"`
	LocalStorageConfig *LocalStorageConfig `json:"storage,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 Phase

type Phase string

Phase is the phase of an operation

type PhyDiskPowerOnTimeStatus

type PhyDiskPowerOnTimeStatus struct {
	Hours   int64 `json:"hours,omitempty"`
	Minutes int64 `json:"minutes,omitempty"`
}

PhyDiskPowerOnTimeStatus struct

func (*PhyDiskPowerOnTimeStatus) DeepCopy

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

func (*PhyDiskPowerOnTimeStatus) DeepCopyInto

func (in *PhyDiskPowerOnTimeStatus) DeepCopyInto(out *PhyDiskPowerOnTimeStatus)

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

type PhyDiskSmartStatus

type PhyDiskSmartStatus struct {
	Passed bool `json:"passed,omitempty"`
}

PhyDiskSmartStatus struct

func (*PhyDiskSmartStatus) DeepCopy

func (in *PhyDiskSmartStatus) DeepCopy() *PhyDiskSmartStatus

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

func (*PhyDiskSmartStatus) DeepCopyInto

func (in *PhyDiskSmartStatus) DeepCopyInto(out *PhyDiskSmartStatus)

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

type PhyDiskTemperatureStatus

type PhyDiskTemperatureStatus struct {
	Current int64 `json:"current,omitempty"`
}

PhyDiskTemperatureStatus struct

func (*PhyDiskTemperatureStatus) DeepCopy

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

func (*PhyDiskTemperatureStatus) DeepCopyInto

func (in *PhyDiskTemperatureStatus) DeepCopyInto(out *PhyDiskTemperatureStatus)

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

type PhysicalDisk

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

	Spec   PhysicalDiskSpec   `json:"spec,omitempty"`
	Status PhysicalDiskStatus `json:"status,omitempty"`
}

PhysicalDisk is the Schema for the physicaldisks API +kubebuilder:subresource:status +kubebuilder:resource:path=physicaldisks,scope=Cluster,shortName=pd +kubebuilder:printcolumn:name="node",type=string,JSONPath=`.spec.nodeName`,description="Node name where the volume replica is located at" +kubebuilder:printcolumn:name="serialNumber",type=string,JSONPath=`.spec.serialNumber`,description="Serial number of the disk" +kubebuilder:printcolumn:name="modelName",type=string,JSONPath=`.spec.modelName`,description="Model name of the disk" +kubebuilder:printcolumn:name="device",type=string,JSONPath=`.spec.devicePath`,description="Disk path in OS" +kubebuilder:printcolumn:name="type",type=string,JSONPath=`.spec.type`,description="Disk type" +kubebuilder:printcolumn:name="protocol",type=string,JSONPath=`.spec.protocol`,description="Disk access protocol" +kubebuilder:printcolumn:name="health",type=boolean,JSONPath=`.status.smartCheck.details.smart_status.passed`,description="Disk health reported by smartctl" +kubebuilder:printcolumn:name="checkTime",type=date,JSONPath=`.status.smartCheck.lastTime`,description="Last time to check disk health" +kubebuilder:printcolumn:name="online",type=boolean,JSONPath=`.status.online`,description="Disk online or offline" +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*PhysicalDisk) DeepCopy

func (in *PhysicalDisk) DeepCopy() *PhysicalDisk

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

func (*PhysicalDisk) DeepCopyInto

func (in *PhysicalDisk) DeepCopyInto(out *PhysicalDisk)

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

func (*PhysicalDisk) DeepCopyObject

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

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

type PhysicalDiskList

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

PhysicalDiskList contains a list of PhysicalDisk

func (*PhysicalDiskList) DeepCopy

func (in *PhysicalDiskList) DeepCopy() *PhysicalDiskList

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

func (*PhysicalDiskList) DeepCopyInto

func (in *PhysicalDiskList) DeepCopyInto(out *PhysicalDiskList)

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

func (*PhysicalDiskList) DeepCopyObject

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

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

type PhysicalDiskSpec

type PhysicalDiskSpec struct {

	// Node name of where the disk is attached
	NodeName string `json:"nodeName,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"`
	// DevicePath is the path in the OS
	DevicePath string `json:"devicePath,omitempty"`
	// Protocol is for data transport, such as ATA, SCSI, NVMe
	Protocol string `json:"protocol,omitempty"`
	// Type is the disk type, such as ata, scsi, nvme, megaraid,N, ...
	Type string `json:"type,omitempty"`
	// Capacity of the disk
	Capacity int64 `json:"capacity,omitempty"`
	// IsRAID identifies if the disk is a raid disk or not
	IsRAID bool `json:"isRaid,omitempty"`
	// 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"`
	// SmartSupport identified if the disk supports SMART or not
	SmartSupport bool `json:"smartSupport,omitempty"`
}

PhysicalDiskSpec defines the desired state of PhysicalDisk

func (*PhysicalDiskSpec) DeepCopy

func (in *PhysicalDiskSpec) DeepCopy() *PhysicalDiskSpec

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

func (*PhysicalDiskSpec) DeepCopyInto

func (in *PhysicalDiskSpec) DeepCopyInto(out *PhysicalDiskSpec)

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

type PhysicalDiskStatus

type PhysicalDiskStatus struct {

	// disk is online or offline. Considering the disk replacement, the replaced disk should be offline
	Online bool `json:"online,omitempty"`

	SmartCheck *SmartCheck `json:"smartCheck,omitempty"`
}

PhysicalDiskStatus defines the observed state of PhysicalDisk

func (*PhysicalDiskStatus) DeepCopy

func (in *PhysicalDiskStatus) DeepCopy() *PhysicalDiskStatus

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

func (*PhysicalDiskStatus) DeepCopyInto

func (in *PhysicalDiskStatus) DeepCopyInto(out *PhysicalDiskStatus)

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

type SCSIErrorCounter

type SCSIErrorCounter struct {
	ErrorsCorrectedByECCFast        int64  `json:"errors_corrected_by_eccfast"`
	ErrorsCorrectedByECCDelayed     int64  `json:"errors_corrected_by_eccdelayed"`
	ErrorsCorrectedByRereadRewrites int64  `json:"errors_corrected_by_rereads_rewrites"`
	TotalErrorsCorrected            int64  `json:"total_errors_corrected"`
	CorrectionAlgorithmInvocations  int64  `json:"correction_algorithm_invocations"`
	GigabytesProcessed              string `json:"gigabytes_processed"`
	TotalUncorrectedErrors          int64  `json:"total_uncorrected_errors"`
}

SCSIErrorCounter struct

func (*SCSIErrorCounter) DeepCopy

func (in *SCSIErrorCounter) DeepCopy() *SCSIErrorCounter

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

func (*SCSIErrorCounter) DeepCopyInto

func (in *SCSIErrorCounter) DeepCopyInto(out *SCSIErrorCounter)

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

type SCSISmartHealthDetailsInfo

type SCSISmartHealthDetailsInfo struct {
	Read   *SCSIErrorCounter `json:"read,omitempty"`
	Write  *SCSIErrorCounter `json:"write,omitempty"`
	Verify *SCSIErrorCounter `json:"verify,omitempty"`
}

SCSISmartHealthDetailsInfo struct

func (*SCSISmartHealthDetailsInfo) DeepCopy

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

func (*SCSISmartHealthDetailsInfo) DeepCopyInto

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

type SmartCheck

type SmartCheck struct {
	// details of the health check by smartctl
	SmartStatus *PhyDiskSmartStatus       `json:"smart_status,omitempty"`
	Temperature *PhyDiskTemperatureStatus `json:"temperature,omitempty"`
	PowerOnTime *PhyDiskPowerOnTimeStatus `json:"power_on_time,omitempty"`

	NVMeSmartHealthStatus *NVMeSmartHealthDetailsInfo `json:"nvme_smart_health_information_log,omitempty"`
	ATASmartHealthStatus  *ATASmartHealthDetailsInfo  `json:"ata_smart_attributes,omitempty"`
	SCSISmartHealthStatus *SCSISmartHealthDetailsInfo `json:"scsi_error_counter_log,omitempty"`

	// latest time for health check
	LastTime *metav1.Time `json:"lastTime,omitempty"`
}

SmartCheck defines the result of the disk smartctl

func (*SmartCheck) DeepCopy

func (in *SmartCheck) DeepCopy() *SmartCheck

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

func (*SmartCheck) DeepCopyInto

func (in *SmartCheck) DeepCopyInto(out *SmartCheck)

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

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 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,omitempty"`

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

	// 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 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

Jump to

Keyboard shortcuts

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