latencyprofilecontroller

package
v0.0.0-...-201d816 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLatencyProfileController

func NewLatencyProfileController(
	instanceName string,
	operatorClient v1helpers.StaticPodOperatorClient,
	targetNamespace string,
	checkProfileRejectionFn CheckProfileRejectionFunc,
	matchRevisionsFn MatchProfileRevisionConfigsFunc,
	nodeInformer configv1informers.NodeInformer,
	kubeInformersForNamespaces v1helpers.KubeInformersForNamespaces,
	eventRecorder events.Recorder,
) factory.Controller

Types

type CheckProfileRejectionFunc

type CheckProfileRejectionFunc func(
	desiredProfile configv1.WorkerLatencyProfileType,
	currentRevisions []int32,
) (isRejected bool, rejectMsg string, err error)

func NewInstallerProfileRejectionChecker

func NewInstallerProfileRejectionChecker(
	configMapLister listersv1.ConfigMapNamespaceLister,
	latencyConfigs []nodeobserver.LatencyConfigProfileTuple,
	profileRejectionScenarios []nodeobserver.LatencyProfileRejectionScenario,
) (CheckProfileRejectionFunc, error)

NewInstallerProfileRejectionChecker is used to construct a CheckProfileRejectionFunc that can compare the (installer controller generated config map) config of the latest active revision with the desired/target latency profile to return whether profile transition should be rejected or not. The latencyConfigs passed to this func check arg values of each latency profile to compare them across the active config on the cluster. In case the transition is from profile found in active config to specified target profile and it is for one of the scenarios specified in profileRejectionScenarios, the rejection flag is returned as true with an appropriate message; false otherwise. Eg. transition between extreme latency profiles viz. Default <-> Low should be rejected.

type LatencyProfileController

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

LatencyProfileController either instantly via the informers or periodically via resync, lists the config/v1/node object and fetches the worker latency profile applied on the cluster which is used to updates the status of respective operator resource that uses this controller. The current state of the operand is by watching the configs applied to different static pod revisions that are active and uses the information to update status as either progressing or completed or degraded. Note: In case new latency profiles are added in the future in openshift/api this could break cluster upgrades and set this controller into degraded state because of an "unknown latency profile" error.

type MatchProfileRevisionConfigsFunc

type MatchProfileRevisionConfigsFunc func(profile configv1.WorkerLatencyProfileType, revisions []int32) (match bool, revisionsHaveSyncedMessage string, err error)

func NewInstallerRevisionConfigMatcher

func NewInstallerRevisionConfigMatcher(
	configMapLister listersv1.ConfigMapNamespaceLister,
	latencyConfigs []nodeobserver.LatencyConfigProfileTuple,
) MatchProfileRevisionConfigsFunc

NewInstallerRevisionConfigMatcher is used to create a MatchProfileRevisionConfigsFunc that can be matches config maps generated by installer controller for various static pod revisions and match if each of the active revisions specified contain arg val pairs specific to given latency profile or not.

Jump to

Keyboard shortcuts

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