All Projects → openshift → vertical-pod-autoscaler-operator

openshift / vertical-pod-autoscaler-operator

Licence: Apache-2.0 license
An Operator for running the Vertical Pod Autoscaler on OpenShift

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Makefile
30231 projects
jq
24 projects
Dockerfile
14818 projects
sed
78 projects

Vertical Pod Autoscaler Operator

The vertical-pod-autoscaler-operator manages deployments and configurations of the OpenShift Vertical Pod Autoscaler's three controllers. The three controllers are:

  • Recommender, which monitors the current and past resource consumption and provides recommended values for containers' CPU and memory requests.
  • Admission Plugin, which sets the correct resource requests on new pods using data from the Recommender. The recommended request values will be applied to new pods which are being restarted (after an eviction by the Updater) or by any other pod restart.
  • Updater, which checks which of the managed pods have incorrect resources set, and evicts any it finds so that the pods can be recreated by their controllers with the updated resource requests.

Custom Resource Definitions

The operator manages the following custom resource:

  • VerticalPodAutoscalerController: This is a singleton resource which controls the configuration of the cluster's VPA 3 controller instances. The operator will only respond to the VerticalPodAutoscalerController resource named "default" in the managed namespace, i.e. the value of the WATCH_NAMESPACE environment variable. (Example)

    Many of fields in the spec for VerticalPodAutoscalerController resources correspond to command-line arguments of the three VPA controllers and also control which controllers should be run. The example linked above results in the following invocation:

      Command:
        recommender
      Args:
        --safetyMarginFraction=0.15
        --podMinCPUMillicores=25
        --podMinMemoryMb=250
    
      Command:
        admission-plugin
    
      Command:
        updater
    

Development

## Build, Test, & Run
$ make build
$ make test

$ export WATCH_NAMESPACE=openshift-vertical-pod-autoscaler
$ ./bin/vertical-pod-autoscaler-operator -alsologtostderr

The Vertical Pod Autoscaler Operator is designed to be deployed on OpenShift by the Cluster Version Operator, but it's possible to run it directly on any vanilla Kubernetes cluster. To do so, apply the manifests in the install/deploy directory: kubectl apply -f ./install/deploy

This will create the openshift-vertical-pod-autoscaler namespace, register the custom resource definitions, configure RBAC policies, and create a deployment for the operator.

End-to-End Tests

You can run the e2e test suite with make test-e2e. These tests assume the presence of a cluster not already running the operator, and that the KUBECONFIG environment variable points to a configuration granting admin rights on said cluster.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].