resourceupdater

package
v0.0.0-...-3acc49a Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller is the controller that recommends resources to the pods. For each Pod Scale assigned to the recommender, it will have a pod saved in a list. Every x seconds, the recommender polls the metrics from the pod by using an http request. For pod metrics it retrieves, it computes the new resources to assign to the pod.

func NewController

func NewController(kubernetesClientset *kubernetes.Clientset,
	podScalesClientset podscalesclientset.Interface,
	informers informers.Informers,
	in chan types.NodeScales) *Controller

NewController returns a new sample controller

func (*Controller) AtomicResourceUpdate

func (c *Controller) AtomicResourceUpdate(pod *corev1.Pod, podScale *v1beta1.PodScale) (*corev1.Pod, *v1beta1.PodScale, error)

AtomicResourceUpdate updates a Pod and its PodScale consistently in order to keep synchronized the two resources. Before performing the real update it runs a request in dry-run and it checks for any potential error

func (*Controller) Run

func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

func (*Controller) Shutdown

func (c *Controller) Shutdown()

Shutdown is called when the controller has finished its work

Jump to

Keyboard shortcuts

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