Documentation ¶
Index ¶
- Constants
- func CPUListToHexMask(cpulist string) (hexMask string, err error)
- func CPUListToMaskList(cpulist string) (hexMask string, err error)
- func CPUMaskToCPUSet(cpuMask string) (cpuset.CPUSet, error)
- func GetComponentName(profileName string, prefix string) string
- func GetFirstKeyAndValue(m map[string]string) (string, string)
- func Intersect(firstSet cpuset.CPUSet, secondSet cpuset.CPUSet) []int
- func ListToString(cpus []int) string
- func SplitLabelKey(s string) (domain, role string, err error)
- type CPULists
- type Handler
- type KubeletConfigOptions
- type MachineConfigOptions
- type Options
Constants ¶
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/" )
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" )
const ( // HugepagesSize2M contains the size of 2M hugepages HugepagesSize2M = "2M" // HugepagesSize1G contains the size of 1G hugepages HugepagesSize1G = "1G" )
const (
// AssetsDir defines the directory with assets under the operator image
AssetsDir = "/assets"
)
Variables ¶
This section is empty.
Functions ¶
func CPUListToHexMask ¶
CPUListToHexMask converts a list of cpus into a cpu mask represented in hexdecimal
func CPUListToMaskList ¶
CPUListToMaskList converts a list of cpus into a cpu mask represented in a list of hexadecimal mask divided by a delimiter ","
func CPUMaskToCPUSet ¶
CPUMaskToCPUSet parses a CPUSet received in a Mask Format, see: https://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS
func GetComponentName ¶
GetComponentName returns the component name for the specific performance profile
func GetFirstKeyAndValue ¶
GetFirstKeyAndValue return the first key / value pair of a map
func ListToString ¶
func SplitLabelKey ¶
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 ¶
NewCPULists parse text representations of reserved and isolated cpusets definition and returns a CPULists object
func (*CPULists) GetIsolated ¶
func (*CPULists) GetOfflined ¶
func (*CPULists) GetReserved ¶
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 MachineConfigOptions ¶
type MachineConfigOptions struct { PinningMode *apiconfigv1.CPUPartitioningMode DefaultRuntime mcov1.ContainerRuntimeDefaultRuntime MixedCPUsEnabled bool }
type Options ¶
type Options struct { ProfileMCP *mcov1.MachineConfigPool MachineConfig MachineConfigOptions }