components

package
v0.0.0-...-1cc1afb Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// ComponentNamePrefix defines the worker role for performance sensitive workflows
	// TODO: change it back to longer name once https://bugzilla.redhat.com/show_bug.cgi?id=1787907 fixed
	// ComponentNamePrefix = "worker-performance"
	ComponentNamePrefix = "performance"
	// MachineConfigRoleLabelKey is the label key to use as label and in MachineConfigSelector of MCP which targets the performance profile
	MachineConfigRoleLabelKey = "machineconfiguration.openshift.io/role"
	// NodeRoleLabelPrefix is the prefix for the role label of a node
	NodeRoleLabelPrefix = "node-role.kubernetes.io/"
)
View Source
const (
	// NamespaceNodeTuningOperator defines the tuned profiles namespace
	NamespaceNodeTuningOperator = "openshift-cluster-node-tuning-operator"
	// ProfileNamePerformance defines the performance tuned profile name
	ProfileNamePerformance = "openshift-node-performance"
	// ProfileNamePerformanceRT defines the performance real time tuned profile name
	ProfileNamePerformanceRT = "openshift-node-performance-rt"
)
View Source
const (
	// HugepagesSize2M contains the size of 2M hugepages
	HugepagesSize2M = "2M"
	// HugepagesSize1G contains the size of 1G hugepages
	HugepagesSize1G = "1G"
)
View Source
const (
	// AssetsDir defines the directory with assets under the operator image
	AssetsDir = "/assets"
)

Variables

This section is empty.

Functions

func CPUListToHexMask

func CPUListToHexMask(cpulist string) (hexMask string, err error)

CPUListToHexMask converts a list of cpus into a cpu mask represented in hexdecimal

func CPUListToMaskList

func CPUListToMaskList(cpulist string) (hexMask string, err error)

CPUListToMaskList converts a list of cpus into a cpu mask represented in a list of hexadecimal mask divided by a delimiter ","

func CPUMaskToCPUSet

func CPUMaskToCPUSet(cpuMask string) (cpuset.CPUSet, error)

CPUMaskToCPUSet parses a CPUSet received in a Mask Format, see: https://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS

func GetComponentName

func GetComponentName(profileName string, prefix string) string

GetComponentName returns the component name for the specific performance profile

func GetFirstKeyAndValue

func GetFirstKeyAndValue(m map[string]string) (string, string)

GetFirstKeyAndValue return the first key / value pair of a map

func Intersect

func Intersect(firstSet cpuset.CPUSet, secondSet cpuset.CPUSet) []int

Intersect returns cpu ids found in both the provided cpuLists, if any

func ListToString

func ListToString(cpus []int) string

func SplitLabelKey

func SplitLabelKey(s string) (domain, role string, err error)

SplitLabelKey returns the given label key splitted up in domain and role

Types

type CPULists

type CPULists struct {
	// contains filtered or unexported fields
}

CPULists allows easy checks between the different cpu set definitions

func NewCPULists

func NewCPULists(reserved, isolated, offlined, shared string) (*CPULists, error)

NewCPULists parse text representations of reserved and isolated cpusets definition and returns a CPULists object

func (*CPULists) GetIsolated

func (c *CPULists) GetIsolated() cpuset.CPUSet

func (*CPULists) GetOfflined

func (c *CPULists) GetOfflined() cpuset.CPUSet

func (*CPULists) GetReserved

func (c *CPULists) GetReserved() cpuset.CPUSet

func (*CPULists) GetSets

func (c *CPULists) GetSets() map[string]cpuset.CPUSet

func (*CPULists) GetShared

func (c *CPULists) GetShared() cpuset.CPUSet

type Handler

type Handler interface {
	// Delete deletes the components owned by the controller
	Delete(ctx context.Context, profileName string) error
	// Exists checks for the existences of the components owned by the controller
	Exists(ctx context.Context, profileName string) bool
	// Apply applies the desired state to the components owned by the controller, or creates them if not exists
	Apply(ctx context.Context, obj client.Object, recorder record.EventRecorder, options *Options) error
}

type KubeletConfigOptions

type KubeletConfigOptions struct {
	MachineConfigPoolSelector map[string]string
	MixedCPUsEnabled          bool
}

type MachineConfigOptions

type MachineConfigOptions struct {
	PinningMode      *apiconfigv1.CPUPartitioningMode
	DefaultRuntime   mcov1.ContainerRuntimeDefaultRuntime
	MixedCPUsEnabled bool
}

type Options

type Options struct {
	ProfileMCP    *mcov1.MachineConfigPool
	MachineConfig MachineConfigOptions
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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