v1

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the discoblocks.ondat.io v1 API group +kubebuilder:object:generate=true +groupName=discoblocks.ondat.io

Index

Constants

This section is empty.

Variables

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

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func InitDiskConfigWebhookDeps

func InitDiskConfigWebhookDeps(kubeClient client.Client, provisioners []string)

InitDiskConfigWebhookDeps configures dependencies for webhook

Types

type AvailabilityMode added in v0.0.2

type AvailabilityMode string

+kubebuilder:validation:Enum=Singleton;Multiple

const (
	Singleton AvailabilityMode = "Singleton"
	Multiple  AvailabilityMode = "Multiple"
)

type DiskConfig

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

	Spec   DiskConfigSpec   `json:"spec,omitempty"`
	Status DiskConfigStatus `json:"status,omitempty"`
}

DiskConfig is the Schema for the diskconfigs API

func (*DiskConfig) DeepCopy

func (in *DiskConfig) DeepCopy() *DiskConfig

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

func (*DiskConfig) DeepCopyInto

func (in *DiskConfig) DeepCopyInto(out *DiskConfig)

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

func (*DiskConfig) DeepCopyObject

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

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

func (*DiskConfig) SetupWebhookWithManager

func (r *DiskConfig) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager sets up the webhook with the Manager.

func (*DiskConfig) ValidateCreate

func (r *DiskConfig) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*DiskConfig) ValidateDelete

func (r *DiskConfig) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*DiskConfig) ValidateUpdate

func (r *DiskConfig) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type DiskConfigList

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

DiskConfigList contains a list of DiskConfig

func (*DiskConfigList) DeepCopy

func (in *DiskConfigList) DeepCopy() *DiskConfigList

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

func (*DiskConfigList) DeepCopyInto

func (in *DiskConfigList) DeepCopyInto(out *DiskConfigList)

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

func (*DiskConfigList) DeepCopyObject

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

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

type DiskConfigSpec

type DiskConfigSpec struct {

	// StorageClassName is the of the StorageClass required by the config.
	//+kubebuilder:validation:Optional
	StorageClassName string `json:"storageClassName,omitempty" yaml:"storageClassName,omitempty"`

	// Capacity represents the desired capacity of the underlying volume.
	//+kubebuilder:default:="1Gi"
	//+kubebuilder:validation:Pattern:="^(\\d+)(m|Mi|g|Gi|t|Ti|p|Pi)$"
	//+kubebuilder:validation:Optional
	Capacity string `json:"capacity,omitempty" yaml:"capacity,omitempty"`

	// MountPointPattern is the mount point of the disk. %d represents disk number in order.
	//+kubebuilder:default:="/media/discoblocks/<name>-%d"
	//+kubebuilder:validation:Pattern:="^/(.*)%d(.*)"
	//+kubebuilder:validation:Optional
	MountPointPattern string `json:"mountPointPattern,omitempty" yaml:"mountPointPattern,omitempty"`

	// AccessModes contains the desired access modes the volume should have.
	// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
	//+kubebuilder:default:={"ReadWriteOnce"}
	//+kubebuilder:validation:Optional
	AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty" yaml:"accessModes,omitempty"`

	// AvailabilityMode defines the desired number of instances.
	//+kubebuilder:default:="Multiple"
	//+kubebuilder:validation:Optional
	AvailabilityMode AvailabilityMode `json:"availabilityMode,omitempty" yaml:"availabilityMode,omitempty"`

	// NodeSelector is a selector which must be true for the disk to fit on a node. Selector which must match a node’s labels for the disk to be provisioned on that node.
	//+kubebuilder:validation:Optional
	NodeSelector *metav1.LabelSelector `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"`

	// PodSelector is a selector which must be true for the pod to attach disk.
	//+kubebuilder:validation:Required
	PodSelector map[string]string `json:"podSelector" yaml:"podSelector"`

	// Policy contains the disk scale policies.
	Policy Policy `json:"policy,omitempty" yaml:"policy,omitempty"`
}

DiskConfigSpec defines the desired state of DiskConfig

func (*DiskConfigSpec) DeepCopy

func (in *DiskConfigSpec) DeepCopy() *DiskConfigSpec

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

func (*DiskConfigSpec) DeepCopyInto

func (in *DiskConfigSpec) DeepCopyInto(out *DiskConfigSpec)

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

type DiskConfigStatus

type DiskConfigStatus struct {

	// Phase is the phase of the Discoblocks provisioning.
	Phase Phase `json:"phase,omitempty" yaml:"phase,omitempty"`

	// Conditions is a list of status of all the disks.
	Conditions []metav1.Condition `json:"conditions,omitempty" yaml:"conditions,omitempty"`

	// PersistentVolumeClaims statuses.
	PersistentVolumeClaims map[string]corev1.PersistentVolumeClaimPhase `json:"pvcs,omitempty" yaml:"pvcs,omitempty"`
}

DiskConfigStatus defines the observed state of DiskConfig

func (*DiskConfigStatus) DeepCopy

func (in *DiskConfigStatus) DeepCopy() *DiskConfigStatus

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

func (*DiskConfigStatus) DeepCopyInto

func (in *DiskConfigStatus) DeepCopyInto(out *DiskConfigStatus)

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

type Phase

type Phase string

+kubebuilder:validation:Enum=Ready;Running;Deleting

const (
	Ready    Phase = "Ready"
	Running  Phase = "Running"
	Deleting Phase = "Deleting"
)

type Policy

type Policy struct {
	// UpscaleTriggerPercentage defines the disk fullness percentage for disk expansion.
	//+kubebuilder:default:=80
	//+kubebuilder:validation:Minimum:=50
	//+kubebuilder:validation:Maximum:=100
	//+kubebuilder:validation:Optional
	UpscaleTriggerPercentage uint8 `json:"upscaleTriggerPercentage,omitempty" yaml:"upscaleTriggerPercentage,omitempty"`

	// MaximumCapacityOfDisks defines maximum capacity of a disk.
	//+kubebuilder:validation:Pattern:="^(\\d+)(m|Mi|g|Gi|t|Ti|p|Pi)$"
	//+kubebuilder:default:="100Gi"
	//+kubebuilder:validation:Optional
	MaximumCapacityOfDisk string `json:"maximumCapacityOfDisk,omitempty" yaml:"maximumCapacityOfDisk,omitempty"`

	// MaximumCapacityOfDisks defines maximum number of a disks.
	//+kubebuilder:default:=10
	//+kubebuilder:validation:Minimum:=1
	//+kubebuilder:validation:Maximum:=1000
	//+kubebuilder:validation:Optional
	MaximumNumberOfDisks uint8 `json:"maximumNumberOfDisks,omitempty" yaml:"maximumNumberOfDisks,omitempty"`
}

Policy defines disk resize policies.

func (*Policy) DeepCopy

func (in *Policy) DeepCopy() *Policy

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

func (*Policy) DeepCopyInto

func (in *Policy) DeepCopyInto(out *Policy)

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

Jump to

Keyboard shortcuts

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