controller

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	//MaxRetryCount controls how many times we re-try a remote API operation
	MaxRetryCount = 150 // counter
	//RetryInterval controls how much time (in milliseconds) we wait between two retry attempts when talking to a remote API
	RetryInterval = 200 // ms
)

Variables

View Source
var (
	ErrSyncPodControllerCacheInfo = errors.New("failed to sync Pod Controller from cache! Are you sure everything is properly connected?")
)

Functions

This section is empty.

Types

type CpuSetController

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

CpuSetController is the data set encapsulating the configuration data needed for the CPUSets Controller to be able to adjust cpusets

func New

func New(kubeConf string, poolConfig types.PoolConfig, cpusetRoot string) (*CpuSetController, error)

New creates a new CpuSetController object Can return error if in-cluster K8s API server client could not be initialized

func (*CpuSetController) CpuSetController

func (cc *CpuSetController) CpuSetController() CpuSetController

CpuSetController returns the CpuSetController data set

func (*CpuSetController) PodAdded

func (cc *CpuSetController) PodAdded(pod *v1.Pod)

PodAdded handles ADD operations

func (*CpuSetController) Run

func (cc *CpuSetController) Run(threadiness int, stopCh *chan struct{}) error

Run kicks the CPUSets controller into motion, synchs it with the API server, and starts the desired number of asynch worker threads to handle the Pod API events

func (*CpuSetController) SetCpuSetController

func (cc *CpuSetController) SetCpuSetController(poolconf types.PoolConfig, cpusetRoot string, k8sClient kubernetes.Interface)

SetCpuSetController a setter for CpuSetController

func (*CpuSetController) StartReconciliation

func (cc *CpuSetController) StartReconciliation()

StartReconciliation starts the reactive thread of CpuSetController periodically checking expected and provisioned cpusets of the node In case a container's observed cpuset differs from the expected (i.e. container was restarted) the thread resets it to the proper value

func (*CpuSetController) Stop

func (cc *CpuSetController) Stop()

Stop is invoked by the main thread to initiate graceful shutdown procedure. It shuts down the event handler queue, and relays a stop signal to the Controller

func (*CpuSetController) WatchErrorHandler

func (cc *CpuSetController) WatchErrorHandler(r *cache.Reflector, err error)

WatchErrorHandler is an event handler invoked when the CPUSets Controller's connection to the K8s API server breaks In case the error is terminal it initiates a graceful shutdown for the whole Controller, implicitly restarting the connection by restarting the whole container

Jump to

Keyboard shortcuts

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