v1alpha1

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the crane API. +k8s:deepcopy-gen=package,register +groupName=topology.crane.io

Index

Constants

View Source
const (
	// AnnotationPodCPUPolicyKey is the pod annotation key of cpu-policy.
	AnnotationPodCPUPolicyKey = "topology.crane.io/cpu-policy"

	// AnnotationPodTopologyAwarenessKey is the pod annotation key of topology-awareness.
	AnnotationPodTopologyAwarenessKey = "topology.crane.io/topology-awareness"

	// AnnotationPodTopologyResultKey is the pod scheduling annotation key of topology-result.
	AnnotationPodTopologyResultKey = "topology.crane.io/topology-result"

	// AnnotationPodExcludeReservedCPUs is the pod annotation key of exclude reserved cpus
	AnnotationPodExcludeReservedCPUs = "topology.crane.io/exclude-reserved-cpus"
)
View Source
const (
	// AnnotationPodCPUPolicyNone specifies none cpu policy. If specified, pod
	// will use the default CPUSet.
	AnnotationPodCPUPolicyNone = "none"

	// AnnotationPodCPUPolicyExclusive specifies exclusive cpu policy.  If specified,
	// pod will never share CPUSet with others.
	AnnotationPodCPUPolicyExclusive = "exclusive"

	// AnnotationPodCPUPolicyNUMA specifies NUMA cpu policy. If specified, pod
	// will use the default CPUSet which belongs to single NUMA node.
	AnnotationPodCPUPolicyNUMA = "numa"

	// AnnotationPodCPUPolicyImmovable specifies immovable cpu policy. If specified,
	// pod will use part of the default CPUSet to avoid uncertain context switch.
	AnnotationPodCPUPolicyImmovable = "immovable"
)
View Source
const GroupName = "topology.crane.io"

GroupName specifies the group name used to register the objects.

View Source
const (
	// LabelNodeTopologyAwarenessKey is the node label key of topology-awareness.
	// This label is used to determine the default topology awareness policy of
	// a node when pod does not specify topology-awareness.
	LabelNodeTopologyAwarenessKey = "topology.crane.io/topology-awareness"
)
View Source
const (
	// ReservedSystemCPUsAttributes is the attributes key represent system reserved cpus
	ReservedSystemCPUsAttributes = "go.crane.io/reserved-system-cpus"
)

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// Depreciated: use Install instead
	AddToScheme = localSchemeBuilder.AddToScheme
	Install     = localSchemeBuilder.AddToScheme
)
View Source
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"}

GroupVersion specifies the group and the version used to register the objects.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects Deprecated: use GroupVersion instead.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CPUManagerPolicy

type CPUManagerPolicy string

CPUManagerPolicy represents policy of the crane agent cpu manager.

const (
	// CPUManagerPolicyNone name of none policy.
	CPUManagerPolicyNone CPUManagerPolicy = "None"
	// CPUManagerPolicyStatic is the name of the static policy.
	CPUManagerPolicyStatic CPUManagerPolicy = "Static"
)

type CostInfo

type CostInfo struct {
	// Name represents the zone name.
	// +required
	Name string `json:"name"`

	// Value represents the cost value.
	// +required
	Value int64 `json:"value"`
}

CostInfo describes the cost (or distance) between two Zones.

func (*CostInfo) DeepCopy

func (in *CostInfo) DeepCopy() *CostInfo

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

func (*CostInfo) DeepCopyInto

func (in *CostInfo) DeepCopyInto(out *CostInfo)

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

type CostList

type CostList []CostInfo

CostList contains an array of CostInfo objects.

func (CostList) DeepCopy

func (in CostList) DeepCopy() CostList

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

func (CostList) DeepCopyInto

func (in CostList) DeepCopyInto(out *CostList)

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

type ManagerPolicy

type ManagerPolicy struct {
	// CPUManagerPolicy represents policy of the crane agent cpu manager.
	// +kubebuilder:validation:Enum=None;Static
	// +required
	CPUManagerPolicy CPUManagerPolicy `json:"cpuManagerPolicy"`

	// TopologyManagerPolicy represents policy of the crane agent resource management component.
	// Defaults to SingleNUMANodePodLevel.
	// +kubebuilder:validation:Enum=None;SingleNUMANodePodLevel
	// +kubebuilder:default=SingleNUMANodePodLevel
	// +required
	TopologyManagerPolicy TopologyManagerPolicy `json:"topologyManagerPolicy"`
}

ManagerPolicy describes the associated manager policy.

func (*ManagerPolicy) DeepCopy

func (in *ManagerPolicy) DeepCopy() *ManagerPolicy

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

func (*ManagerPolicy) DeepCopyInto

func (in *ManagerPolicy) DeepCopyInto(out *ManagerPolicy)

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

type NodeResourceTopology

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

	// CraneManagerPolicy describes the associated manager policy of crane agent.
	// +required
	CraneManagerPolicy ManagerPolicy `json:"craneManagerPolicy"`

	// Reserved describes resources reserved for system and kubernetes components.
	// +optional
	Reserved corev1.ResourceList `json:"reserved,omitempty"`

	// Zones represents all resource topology zones of a node.
	// +optional
	Zones ZoneList `json:"zones,omitempty"`

	// Attributes represents node attributes if any.
	// +optional
	Attributes map[string]string `json:"attributes,omitempty"`
}

NodeResourceTopology describes node resources and their topology.

func (*NodeResourceTopology) DeepCopy

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

func (*NodeResourceTopology) DeepCopyInto

func (in *NodeResourceTopology) DeepCopyInto(out *NodeResourceTopology)

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

func (*NodeResourceTopology) DeepCopyObject

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

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

type NodeResourceTopologyList

type NodeResourceTopologyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []NodeResourceTopology `json:"items"`
}

NodeResourceTopologyList is a list of NodeResourceTopology resources

func (*NodeResourceTopologyList) DeepCopy

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

func (*NodeResourceTopologyList) DeepCopyInto

func (in *NodeResourceTopologyList) DeepCopyInto(out *NodeResourceTopologyList)

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

func (*NodeResourceTopologyList) DeepCopyObject

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

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

type ResourceInfo

type ResourceInfo struct {
	// Capacity of the resource, corresponding to capacity in node status, i.e.
	// total amount of this resource that the node has.
	// +optional
	Capacity corev1.ResourceList `json:"capacity,omitempty"`

	// Allocatable quantity of the resource, corresponding to allocatable in
	// node status, i.e. total amount of this resource available to be used by
	// pods.
	// +optional
	Allocatable corev1.ResourceList `json:"allocatable,omitempty"`

	// ReservedCPUNums specifies the cpu numbers reserved for the host level system threads and kubernetes related threads.
	// +optional
	ReservedCPUNums int32 `json:"reservedCPUNums,omitempty"`
}

ResourceInfo contains information about one resource type.

func (*ResourceInfo) DeepCopy

func (in *ResourceInfo) DeepCopy() *ResourceInfo

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

func (*ResourceInfo) DeepCopyInto

func (in *ResourceInfo) DeepCopyInto(out *ResourceInfo)

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

type TopologyManagerPolicy

type TopologyManagerPolicy string

TopologyManagerPolicy represents policy of the crane agent resource management component.

const (
	// TopologyManagerPolicyNone policy is the default policy and does not perform any topology alignment.
	TopologyManagerPolicyNone TopologyManagerPolicy = "None"
	// TopologyManagerPolicySingleNUMANodePodLevel enables pod level resource counting, this policy assumes
	// TopologyManager policy single-numa-node also was set on the node.
	TopologyManagerPolicySingleNUMANodePodLevel TopologyManagerPolicy = "SingleNUMANodePodLevel"
)

Constants of type TopologyManagerPolicy represent policy of the agent node's resource management component. It's TopologyManager in kubele.

type Zone

type Zone struct {
	// Name represents the zone name.
	// +required
	Name string `json:"name"`

	// Type represents the zone type.
	// +kubebuilder:validation:Enum=Node;Socket;Core
	// +required
	Type ZoneType `json:"type"`

	// Parent represents the name of parent zone.
	// +optional
	Parent string `json:"parent,omitempty"`

	// Costs represents the cost between different zones.
	// +optional
	Costs CostList `json:"costs,omitempty"`

	// Attributes represents zone attributes if any.
	// +optional
	Attributes map[string]string `json:"attributes,omitempty"`

	// Resources represents the resource info of the zone.
	// +optional
	Resources *ResourceInfo `json:"resources,omitempty"`
}

Zone represents a resource topology zone, e.g. socket, node, die or core.

func (*Zone) DeepCopy

func (in *Zone) DeepCopy() *Zone

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

func (*Zone) DeepCopyInto

func (in *Zone) DeepCopyInto(out *Zone)

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

type ZoneList

type ZoneList []Zone

ZoneList contains an array of Zone objects.

func (ZoneList) DeepCopy

func (in ZoneList) DeepCopy() ZoneList

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

func (ZoneList) DeepCopyInto

func (in ZoneList) DeepCopyInto(out *ZoneList)

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

type ZoneType

type ZoneType string

ZoneType string describes a topology type for a zone

const (
	ZoneTypeNode   ZoneType = "Node"
	ZoneTypeSocket ZoneType = "Socket"
	ZoneTypeCore   ZoneType = "Core"
)

Jump to

Keyboard shortcuts

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