v1alpha1

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 35

Documentation

Overview

Package v1alpha1 provides alpha API for Katalyst Node API objects.

Index

Constants

View Source
const (
	// GroupName is the group name used in this package
	GroupName string = "node.katalyst.kubewharf.io"
)
View Source
const (
	ResourceNameKatalystCNR = "customnoderesources"
)

ResourceNameKatalystCNR is used to construct standard gvr

Variables

View Source
var (
	// SchemeBuilder collects schemas to build.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is used by generated client to add this scheme to the generated client.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Allocation

type Allocation struct {
	Consumer string `json:"consumer"`
	// +optional
	Requests *v1.ResourceList `json:"requests,omitempty"`
}

func (*Allocation) DeepCopy

func (in *Allocation) DeepCopy() *Allocation

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

func (*Allocation) DeepCopyInto

func (in *Allocation) DeepCopyInto(out *Allocation)

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

type Attribute added in v0.1.2

type Attribute struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Attribute records the resource-specified info with name-value pairs

func (*Attribute) DeepCopy added in v0.1.2

func (in *Attribute) DeepCopy() *Attribute

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

func (*Attribute) DeepCopyInto added in v0.1.2

func (in *Attribute) DeepCopyInto(out *Attribute)

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

type CNRCondition

type CNRCondition struct {
	// Type is the type of the condition.
	Type CNRConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status v1.ConditionStatus `json:"status" `
	// Last time we got an update on a given condition.
	// +optional
	LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime,omitempty"`
	// (brief) reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`
	// Human-readable message indicating details about last transition.
	// +optional
	Message string `json:"message,omitempty"`
}

CNRCondition contains condition information for a cnr.

func (*CNRCondition) DeepCopy

func (in *CNRCondition) DeepCopy() *CNRCondition

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

func (*CNRCondition) DeepCopyInto

func (in *CNRCondition) DeepCopyInto(out *CNRCondition)

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

type CNRConditionType

type CNRConditionType string
const (
	CNRAgentReady    CNRConditionType = "AgentReady"
	CNRAgentNotFound CNRConditionType = "AgentNotFound"
)

type CustomNodeResource

type CustomNodeResource struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the behavior of a CustomNodeResource.
	// +optional
	Spec CustomNodeResourceSpec `json:"spec,omitempty"`

	// Status represents the current information about a CustomNodeResource.
	// This data may not be up-to-date.
	// +optional
	Status CustomNodeResourceStatus `json:"status,omitempty"`
}

CustomNodeResource captures information about a custom defined node resource CustomNodeResource objects are non-namespaced.

func (*CustomNodeResource) DeepCopy

func (in *CustomNodeResource) DeepCopy() *CustomNodeResource

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

func (*CustomNodeResource) DeepCopyInto

func (in *CustomNodeResource) DeepCopyInto(out *CustomNodeResource)

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

func (*CustomNodeResource) DeepCopyObject

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

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

type CustomNodeResourceList

type CustomNodeResourceList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard list metadata
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// items is the list of CNRs
	Items []CustomNodeResource `json:"items"`
}

CustomNodeResourceList is a collection of CustomNodeResource objects.

func (*CustomNodeResourceList) DeepCopy

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

func (*CustomNodeResourceList) DeepCopyInto

func (in *CustomNodeResourceList) DeepCopyInto(out *CustomNodeResourceList)

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

func (*CustomNodeResourceList) DeepCopyObject

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

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

type CustomNodeResourceSpec

type CustomNodeResourceSpec struct {
	// +optional
	NodeResourceProperties []*Property `json:"nodeResourceProperties,omitempty"`

	// customized taint for katalyst, which may affect partial tasks
	// +optional
	Taints []*Taint `json:"taints,omitempty"`
}

func (*CustomNodeResourceSpec) DeepCopy

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

func (*CustomNodeResourceSpec) DeepCopyInto

func (in *CustomNodeResourceSpec) DeepCopyInto(out *CustomNodeResourceSpec)

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

type CustomNodeResourceStatus

type CustomNodeResourceStatus struct {
	// Resources defines the numeric quantities in this node; for instance reclaimed resources for this node
	Resources Resources `json:"resources"`

	// +optional
	TopologyZone []*TopologyZone `json:"topologyZone,omitempty"`

	// TopologyPolicy indicates placement policy for scheduler or other centralized components to follow.
	// this policy (including topology scope) is defined in topology-manager, katalyst is
	// responsible to parse the policy, and transform to TopologyPolicy here.
	// +kubebuilder:default:=none
	TopologyPolicy TopologyPolicy `json:"topologyPolicy"`

	// Conditions is an array of current observed cnr conditions.
	// +optional
	Conditions []CNRCondition `json:"conditions,omitempty"`
}

func (*CustomNodeResourceStatus) DeepCopy

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

func (*CustomNodeResourceStatus) DeepCopyInto

func (in *CustomNodeResourceStatus) DeepCopyInto(out *CustomNodeResourceStatus)

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

type Property

type Property struct {
	// property name
	PropertyName string `json:"propertyName"`

	// values of the specific property
	// +optional
	PropertyValues []string `json:"propertyValues,omitempty"`

	// values of the quantity-types property
	// +optional
	PropertyQuantity *resource.Quantity `json:"propertyQuantity,omitempty"`
}

func (*Property) DeepCopy

func (in *Property) DeepCopy() *Property

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

func (*Property) DeepCopyInto

func (in *Property) DeepCopyInto(out *Property)

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

type Resources added in v0.1.2

type Resources struct {
	// +optional
	Allocatable *v1.ResourceList `json:"allocatable,omitempty"`

	// +optional
	Capacity *v1.ResourceList `json:"capacity,omitempty"`
}

func (*Resources) DeepCopy added in v0.1.2

func (in *Resources) DeepCopy() *Resources

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

func (*Resources) DeepCopyInto added in v0.1.2

func (in *Resources) DeepCopyInto(out *Resources)

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

type Taint

type Taint struct {
	// Required. The taint key to be applied to a node.
	Key string `json:"key,omitempty"`
	// Required. The taint value corresponding to the taint key.
	// +optional
	Value string `json:"value,omitempty"`
	// Required. The effect of the taint on pods
	// that do not tolerate the taint.
	// Valid effects are NoScheduleForReclaimedTasks.
	Effect TaintEffect `json:"effect,omitempty"`
}

func (*Taint) DeepCopy

func (in *Taint) DeepCopy() *Taint

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

func (*Taint) DeepCopyInto

func (in *Taint) DeepCopyInto(out *Taint)

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

type TaintEffect

type TaintEffect string
const (
	// TaintEffectNoScheduleForReclaimedTasks
	// Do not allow new pods using reclaimed resources to schedule onto the node unless they tolerate the taint,
	// but allow all pods submitted to Kubelet without going through the scheduler
	// to start, and allow all already-running pods to continue running.
	// Enforced by the scheduler.
	TaintEffectNoScheduleForReclaimedTasks TaintEffect = "NoScheduleForReclaimedTasks"
)

type TopologyPolicy added in v0.1.2

type TopologyPolicy string
const (
	TopologyPolicyNone TopologyPolicy = "none"
)

type TopologyType added in v0.1.2

type TopologyType string
const (
	// TopologyTypeSocket indicates socket-level topology
	TopologyTypeSocket TopologyType = "Socket"

	// TopologyTypeNuma indicates numa-level topology
	TopologyTypeNuma TopologyType = "Numa"

	// TopologyTypeGPU indicates a zone for gpu device
	TopologyTypeGPU TopologyType = "GPU"

	// TopologyTypeNIC indicates a zone for network device
	TopologyTypeNIC TopologyType = "NIC"
)

type TopologyZone added in v0.1.2

type TopologyZone struct {
	// Type represents which kind of resource this TopologyZone is for;
	// for instance, Socket, Numa, GPU, NIC, Disk and so on.
	Type TopologyType `json:"type"`

	// Name represents the name for the given type for resource; for instance,
	// - disk-for-log, disk-for-storage may have different usage or attributes, so we
	//   need separate structure to distinguish them.
	// +optional
	Name string `json:"name,omitempty"`

	// Resources defines the numeric quantities in this TopologyZone; for instance,
	// - a TopologyZone with type TopologyTypeGPU may have both gpu and gpu-memory
	// - a TopologyZone with type TopologyTypeNIC may have both ingress and egress bandwidth
	Resources Resources `json:"resources"`

	// +optional
	// +patchMergeKey=name
	// +patchStrategy=merge
	Attributes []Attribute `json:"attributes,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// +optional
	// +patchMergeKey=consumer
	// +patchStrategy=merge
	Allocations []*Allocation `json:"allocations,omitempty" patchStrategy:"merge" patchMergeKey:"consumer"`

	// Children represents the ownerships between multiple TopologyZone; for instance,
	// - a TopologyZone with type TopologyTypeSocket may have multiple childed TopologyZone
	//   with type TopologyTypeNuma to reflect the physical connections for a node
	// - a TopologyZone with type `nic` may have multiple childed TopologyZone with type `vf`
	//   to reflect the `physical and virtual` relations between devices
	// todo: in order to bypass the lacked functionality of recursive structure definition,
	//  we need to skip validation of this field for now; will re-add this validation logic
	//  if the community supports $ref, for more information, please
	//  refer to https://github.com/kubernetes/kubernetes/issues/62872
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Children []*TopologyZone `json:"children,omitempty"`
}

func (*TopologyZone) DeepCopy added in v0.1.2

func (in *TopologyZone) DeepCopy() *TopologyZone

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

func (*TopologyZone) DeepCopyInto added in v0.1.2

func (in *TopologyZone) DeepCopyInto(out *TopologyZone)

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