v1alpha1

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: Apache-2.0 Imports: 21 Imported by: 6

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the imperator v1alpha1 API group +kubebuilder:object:generate=true +groupName=imperator.tenzen-y.io

Index

Constants

View Source
const (
	ConditionReady = "Ready"
)

Variables

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

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

	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func GenerateAffinityMatchExpression

func GenerateAffinityMatchExpression(machineType *MachineType, machineGroup string) []corev1.NodeSelectorRequirement

func GenerateMachineTypeLabelTaintKey

func GenerateMachineTypeLabelTaintKey(machineTypeName string) string

func GenerateToleration

func GenerateToleration(machineTypeName, machineGroup string) []corev1.Toleration

func NewResourceInjector

func NewResourceInjector(c client.Client) *resourceInjector

Types

type AvailableMachineCondition

type AvailableMachineCondition struct {

	// +kubebuilder:validation:Required
	Name string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	Usage UsageCondition `json:"usage,omitempty"`
}

func (*AvailableMachineCondition) DeepCopy

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

func (*AvailableMachineCondition) DeepCopyInto

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

type GPUSpec

type GPUSpec struct {

	// +optional
	Type corev1.ResourceName `json:"type,omitempty"`

	// +optional
	Num resource.Quantity `json:"num,omitempty"`

	// nvidia.com/gpu.family
	// +optional
	Family string `json:"family,omitempty"`

	// nvidia.com/gpu.product
	// +optional
	Product string `json:"product,omitempty"`

	// nvidia.com/gpu.machine
	// +optional
	Machine string `json:"machine,omitempty"`
}

func (*GPUSpec) DeepCopy

func (in *GPUSpec) DeepCopy() *GPUSpec

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

func (*GPUSpec) DeepCopyInto

func (in *GPUSpec) DeepCopyInto(out *GPUSpec)

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

type Machine

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

	Spec   MachineSpec   `json:"spec,omitempty"`
	Status MachineStatus `json:"status,omitempty"`
}

Machine is the Schema for the machines API

func (*Machine) DeepCopy

func (in *Machine) DeepCopy() *Machine

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

func (*Machine) DeepCopyInto

func (in *Machine) DeepCopyInto(out *Machine)

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

func (*Machine) DeepCopyObject

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

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

func (*Machine) Default

func (r *Machine) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*Machine) SetupWebhookWithManager

func (r *Machine) SetupWebhookWithManager(signalHandler context.Context, mgr ctrl.Manager) error

func (*Machine) ValidateAllOperation

func (r *Machine) ValidateAllOperation() error

func (*Machine) ValidateCreate

func (r *Machine) ValidateCreate() error

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

func (*Machine) ValidateDelete

func (r *Machine) ValidateDelete() error

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

func (*Machine) ValidateGPUSpec

func (r *Machine) ValidateGPUSpec() error

func (*Machine) ValidateLabel

func (r *Machine) ValidateLabel() error

func (*Machine) ValidateNodeName

func (r *Machine) ValidateNodeName() error

func (*Machine) ValidateNodePoolMachineTypeName

func (r *Machine) ValidateNodePoolMachineTypeName() error

func (*Machine) ValidateUpdate

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

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

type MachineDetailSpec

type MachineDetailSpec struct {

	// +kubebuilder:validation:Required
	CPU resource.Quantity `json:"cpu"`

	// +kubebuilder:validation:Required
	Memory resource.Quantity `json:"memory"`

	// +optional
	GPU *GPUSpec `json:"gpu,omitempty"`
}

func (*MachineDetailSpec) DeepCopy

func (in *MachineDetailSpec) DeepCopy() *MachineDetailSpec

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

func (*MachineDetailSpec) DeepCopyInto

func (in *MachineDetailSpec) DeepCopyInto(out *MachineDetailSpec)

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

type MachineList

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

MachineList contains a list of Machine

func (*MachineList) DeepCopy

func (in *MachineList) DeepCopy() *MachineList

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

func (*MachineList) DeepCopyInto

func (in *MachineList) DeepCopyInto(out *MachineList)

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

func (*MachineList) DeepCopyObject

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

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

type MachineNodeCondition

type MachineNodeCondition string

MachineNodeCondition is condition of Kubernetes Nodes +kubebuilder:validation:Enum=Healthy;Maintenance;Unhealthy

const (
	NodeHealthy     MachineNodeCondition = "Healthy"
	NodeMaintenance MachineNodeCondition = "Maintenance"
	NodeUnhealthy   MachineNodeCondition = "Unhealthy"
)

type MachineNodePool

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

	Spec   MachineNodePoolSpec   `json:"spec,omitempty"`
	Status MachineNodePoolStatus `json:"status,omitempty"`
}

MachineNodePool is the Schema for the machinenodepools API

func (*MachineNodePool) DeepCopy

func (in *MachineNodePool) DeepCopy() *MachineNodePool

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

func (*MachineNodePool) DeepCopyInto

func (in *MachineNodePool) DeepCopyInto(out *MachineNodePool)

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

func (*MachineNodePool) DeepCopyObject

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

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

type MachineNodePoolList

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

MachineNodePoolList contains a list of MachineNodePool

func (*MachineNodePoolList) DeepCopy

func (in *MachineNodePoolList) DeepCopy() *MachineNodePoolList

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

func (*MachineNodePoolList) DeepCopyInto

func (in *MachineNodePoolList) DeepCopyInto(out *MachineNodePoolList)

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

func (*MachineNodePoolList) DeepCopyObject

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

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

type MachineNodePoolSpec

type MachineNodePoolSpec struct {

	// MachineGroupName is node pool group
	// +kubebuilder:validation:Required
	MachineGroupName string `json:"machineGroupName"`

	// NodePool is node list that machineGroup is managing.
	// +kubebuilder:validation:Required
	NodePool []NodePool `json:"nodePool"`

	// MachineTypeStock is available machineType list.
	// +kubebuilder:validation:Required
	MachineTypeStock []NodePoolMachineTypeStock `json:"machineTypeStock"`
}

MachineNodePoolSpec defines the desired state of MachineNodePool

func (*MachineNodePoolSpec) DeepCopy

func (in *MachineNodePoolSpec) DeepCopy() *MachineNodePoolSpec

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

func (*MachineNodePoolSpec) DeepCopyInto

func (in *MachineNodePoolSpec) DeepCopyInto(out *MachineNodePoolSpec)

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

type MachineNodePoolStatus

type MachineNodePoolStatus struct {

	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// +optional
	NodePoolCondition []NodePoolCondition `json:"nodePool,omitempty"`
}

MachineNodePoolStatus defines the observed state of MachineNodePool

func (*MachineNodePoolStatus) DeepCopy

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

func (*MachineNodePoolStatus) DeepCopyInto

func (in *MachineNodePoolStatus) DeepCopyInto(out *MachineNodePoolStatus)

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

type MachineSpec

type MachineSpec struct {

	// NodePool is node list that machineGroup is managing.
	// +kubebuilder:validation:Required
	NodePool []NodePool `json:"nodePool"`

	// +kubebuilder:validation:Required
	MachineTypes []MachineType `json:"machineTypes"`
}

MachineSpec defines the desired state of Machine

func (*MachineSpec) DeepCopy

func (in *MachineSpec) DeepCopy() *MachineSpec

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

func (*MachineSpec) DeepCopyInto

func (in *MachineSpec) DeepCopyInto(out *MachineSpec)

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

type MachineStatus

type MachineStatus struct {

	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// +kubebuilder:validation:Required
	AvailableMachines []AvailableMachineCondition `json:"availableMachines,omitempty"`
}

MachineStatus defines the observed state of Machine

func (*MachineStatus) DeepCopy

func (in *MachineStatus) DeepCopy() *MachineStatus

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

func (*MachineStatus) DeepCopyInto

func (in *MachineStatus) DeepCopyInto(out *MachineStatus)

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

type MachineType

type MachineType struct {

	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// +kubebuilder:validation:Required
	Spec MachineDetailSpec `json:"spec"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum:=0
	Available int32 `json:"available"`
}

func (*MachineType) DeepCopy

func (in *MachineType) DeepCopy() *MachineType

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

func (*MachineType) DeepCopyInto

func (in *MachineType) DeepCopyInto(out *MachineType)

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

type NodePool

type NodePool struct {

	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=ready;maintenance
	Mode NodePoolMode `json:"mode"`

	// +optional
	// default=false
	Taint bool `json:"taint,omitempty"`

	// +kubebuilder:validation:Required
	MachineType []NodePoolMachineType `json:"machineType"`
}

func (*NodePool) DeepCopy

func (in *NodePool) DeepCopy() *NodePool

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

func (*NodePool) DeepCopyInto

func (in *NodePool) DeepCopyInto(out *NodePool)

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

type NodePoolCondition

type NodePoolCondition struct {

	// +optional
	Name string `json:"name,omitempty"`

	// +optional
	NodeCondition MachineNodeCondition `json:"condition,omitempty"`
}

func (*NodePoolCondition) DeepCopy

func (in *NodePoolCondition) DeepCopy() *NodePoolCondition

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

func (*NodePoolCondition) DeepCopyInto

func (in *NodePoolCondition) DeepCopyInto(out *NodePoolCondition)

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

type NodePoolMachineType

type NodePoolMachineType struct {

	// +kubebuilder:validation:Required
	Name string `json:"name"`
}

func (*NodePoolMachineType) DeepCopy

func (in *NodePoolMachineType) DeepCopy() *NodePoolMachineType

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

func (*NodePoolMachineType) DeepCopyInto

func (in *NodePoolMachineType) DeepCopyInto(out *NodePoolMachineType)

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

type NodePoolMachineTypeStock

type NodePoolMachineTypeStock struct {

	// +kubebuilder:validation:Required
	Name string `json:"name"`
}

func (*NodePoolMachineTypeStock) DeepCopy

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

func (*NodePoolMachineTypeStock) DeepCopyInto

func (in *NodePoolMachineTypeStock) DeepCopyInto(out *NodePoolMachineTypeStock)

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

type NodePoolMode

type NodePoolMode string
const (
	NodeModeReady       NodePoolMode = "ready"
	NodeModeNotReady    NodePoolMode = "not-ready"
	NodeModeMaintenance NodePoolMode = "maintenance"
)

func (NodePoolMode) Value

func (mode NodePoolMode) Value() string

type UsageCondition

type UsageCondition struct {

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum:=0
	Maximum int32 `json:"maximum"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum:=0
	Reserved int32 `json:"reserved"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum:=0
	Used int32 `json:"used"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum:=0
	Waiting int32 `json:"waiting"`
}

func (*UsageCondition) DeepCopy

func (in *UsageCondition) DeepCopy() *UsageCondition

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

func (*UsageCondition) DeepCopyInto

func (in *UsageCondition) DeepCopyInto(out *UsageCondition)

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