v1alpha1

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 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
	// +optional
	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"`

	// NodeMetricStatus report node real-time metrics
	// +optional
	NodeMetricStatus *NodeMetricStatus `json:"nodeMetricStatus,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 GroupMetricInfo added in v0.5.0

type GroupMetricInfo struct {
	// +kubebuilder:validation:Enum=reclaimed_cores;shared_cores;dedicated_cores;system_cores
	QoSLevel      string `json:"QoSLevel"`
	ResourceUsage `json:",inline"`
	// PodList indicates the pods belongs to this qos group, in format of {namespace}/{name}.
	// Pods that have been scheduled but are not listed in the PodList need to be estimated by the scheduler.
	PodList []string `json:"podList,omitempty"`
}

func (*GroupMetricInfo) DeepCopy added in v0.5.0

func (in *GroupMetricInfo) DeepCopy() *GroupMetricInfo

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

func (*GroupMetricInfo) DeepCopyInto added in v0.5.0

func (in *GroupMetricInfo) DeepCopyInto(out *GroupMetricInfo)

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

type NUMAMetricInfo added in v0.5.0

type NUMAMetricInfo struct {
	NUMAId int `json:"numaId"`
	// Usage contains the real-time resource usage for this NUMA node
	Usage *ResourceMetric `json:"usage"`
}

func (*NUMAMetricInfo) DeepCopy added in v0.5.0

func (in *NUMAMetricInfo) DeepCopy() *NUMAMetricInfo

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

func (*NUMAMetricInfo) DeepCopyInto added in v0.5.0

func (in *NUMAMetricInfo) DeepCopyInto(out *NUMAMetricInfo)

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

type NodeMetricInfo added in v0.5.0

type NodeMetricInfo struct {
	ResourceUsage `json:",inline"`
}

func (*NodeMetricInfo) DeepCopy added in v0.5.0

func (in *NodeMetricInfo) DeepCopy() *NodeMetricInfo

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

func (*NodeMetricInfo) DeepCopyInto added in v0.5.0

func (in *NodeMetricInfo) DeepCopyInto(out *NodeMetricInfo)

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

type NodeMetricStatus added in v0.5.0

type NodeMetricStatus struct {
	// UpdateTime is the last time this NodeMetricStatus was updated.
	UpdateTime metav1.Time `json:"updateTime"`

	// NodeMetric contains the metrics for this node.
	NodeMetric *NodeMetricInfo `json:"nodeMetric,omitempty"`

	// GroupMetric contains the metrics aggregated by QoS level groups
	GroupMetric []GroupMetricInfo `json:"groupMetric,omitempty"`
}

NodeMetricStatus defines the observed state of NodeMetric

func (*NodeMetricStatus) DeepCopy added in v0.5.0

func (in *NodeMetricStatus) DeepCopy() *NodeMetricStatus

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

func (*NodeMetricStatus) DeepCopyInto added in v0.5.0

func (in *NodeMetricStatus) DeepCopyInto(out *NodeMetricStatus)

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 ResourceMetric added in v0.5.0

type ResourceMetric struct {
	CPU    *resource.Quantity `json:"cpu,omitempty"`
	Memory *resource.Quantity `json:"memory,omitempty"`
}

func (*ResourceMetric) DeepCopy added in v0.5.0

func (in *ResourceMetric) DeepCopy() *ResourceMetric

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

func (*ResourceMetric) DeepCopyInto added in v0.5.0

func (in *ResourceMetric) DeepCopyInto(out *ResourceMetric)

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

type ResourceUsage added in v0.5.0

type ResourceUsage struct {
	// NUMAUsage contains the real-time resource usage for each NUMA
	NUMAUsage []NUMAMetricInfo `json:"numaUsage,omitempty"`

	// GenericUsage contains the real-time resource usage
	GenericUsage *ResourceMetric `json:"genericUsage,omitempty"`
}

func (*ResourceUsage) DeepCopy added in v0.5.0

func (in *ResourceUsage) DeepCopy() *ResourceUsage

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

func (*ResourceUsage) DeepCopyInto added in v0.5.0

func (in *ResourceUsage) DeepCopyInto(out *ResourceUsage)

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 Sibling added in v0.1.7

type Sibling struct {
	// Type represents the type of this Sibling.
	// For instance, Socket, Numa, GPU, NIC, Disk and so on.
	Type TopologyType `json:"type"`

	// Name represents the name of this Sibling.
	Name string `json:"name"`

	// Attributes are the attributes of the relationship between two Zones.
	// For instance, the distance between tow NUMA nodes, the connection type between two GPUs, etc.
	// +patchMergeKey=name
	// +patchStrategy=merge
	Attributes []Attribute `json:"attributes,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
}

Sibling describes the relationship between two Zones.

func (*Sibling) DeepCopy added in v0.1.7

func (in *Sibling) DeepCopy() *Sibling

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

func (*Sibling) DeepCopyInto added in v0.1.7

func (in *Sibling) DeepCopyInto(out *Sibling)

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 policy is the default policy and does not perform any topology alignment.
	TopologyPolicyNone TopologyPolicy = "None"

	// TopologyPolicySingleNUMANodeContainerLevel represents single-numa-node policy and container level.
	TopologyPolicySingleNUMANodeContainerLevel TopologyPolicy = "SingleNUMANodeContainerLevel"

	// TopologyPolicySingleNUMANodePodLevel represents single-numa-node policy and pod level.
	TopologyPolicySingleNUMANodePodLevel TopologyPolicy = "SingleNUMANodePodLevel"

	// TopologyPolicyRestrictedContainerLevel represents restricted policy and container level.
	TopologyPolicyRestrictedContainerLevel TopologyPolicy = "RestrictedContainerLevel"

	// TopologyPolicyRestrictedPodLevel represents restricted policy and pod level.
	TopologyPolicyRestrictedPodLevel TopologyPolicy = "RestrictedPodLevel"

	// TopologyPolicyBestEffortContainerLevel represents best-effort policy and container level.
	TopologyPolicyBestEffortContainerLevel TopologyPolicy = "BestEffortContainerLevel"

	// TopologyPolicyBestEffortPodLevel represents best-effort policy and pod level.
	TopologyPolicyBestEffortPodLevel TopologyPolicy = "BestEffortPodLevel"

	// TopologyPolicyNumericContainerLevel represents numeric policy and container level.
	TopologyPolicyNumericContainerLevel TopologyPolicy = "NumericContainerLevel"

	// TopologyPolicyNumericPodLevel represents numeric policy and pod level.
	TopologyPolicyNumericPodLevel TopologyPolicy = "NumericPodLevel"
)

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.
	Name string `json:"name"`

	// 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
	// +optional
	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"`

	// Siblings represents the relationship between TopologyZones at the same level; for instance,
	// the distance between NUMA nodes.
	// +optional
	// +patchMergeKey=name
	// +patchStrategy=merge
	Siblings []Sibling `json:"siblings,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
}

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