recommender

command
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

README

MPA Recommender

Intro

Recommender is the core binary of Multi-dimensiional Pod Autoscaler (MPA) system. It consists of both vertical and horizontal scaling of resources:

  • Vertical: It computes the recommended resource requests for pods based on historical and current usage of the resources. Like VPA, the current recommendations are put in status of the MPA object, where they can be inspected.
  • Horizontal: It updates the number of replicas based on specified target metrics threshold according to the following formula:
desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )]
  • Combined: To be released.
    • The current way of combining vertical and horizontal scaling is simple: Each dimension is alternatively being considered. In the future, we will design and implement prioritization (e.g., to prioritize horizontal scaling for CPU-instensive workloads) and conflict-resolving (e.g., scaling in and up simultaneuously) mechanisms.

Running

  • In order to have historical data pulled in by the recommender, install Prometheus in your cluster and pass its address through a flag.
  • Create RBAC configuration from ../../deploy/mpa-rbac.yaml if not yet.
  • Create a deployment with the recommender pod from ../../deploy/recommender-deployment.yaml.
  • The recommender will start running and pushing its recommendations to MPA object statuses.

Implementation

The recommender is based on a model of the cluster that it builds in its memory. The model contains Kubernetes resources: Pods, MultidimPodAutoscalers, with their configuration (e.g. labels) as well as other information, e.g., usage data for each container.

After starting the binary, the recommender reads the history of running pods and their usage from Prometheus into the model. It then runs in a loop and at each step performs the following actions:

  • update model with recent information on resources (using listers based on watch),
  • update model with fresh usage samples from Metrics API,
  • compute new recommendation for each MPA,
  • put any changed recommendations into the MPA objects.

Building the Docker Image

make build-binary-with-vendor-amd64
make docker-build-amd64

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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