Skip to content

Latest commit

 

History

History
66 lines (37 loc) · 3.04 KB

DESIGN.md

File metadata and controls

66 lines (37 loc) · 3.04 KB

goldilocks

People

Owner: @sudermanjr Only other main contributor: @davekonopka

Intent

The intent of goldilocks is to utilize an already somewhat-stable resource recommendation engine and aggregate the results into a nice dashboard. The goal is to allow end-users to easily see a sane recommendation for how to set their resource requests and limits on their containers.

Key Elements

  • VPA (vertical pod autoscaler) is the core of the project. It will be utilized to provide the resource recommendations.
  • Controller - manage the creation and deletion of VPA objects in specified namespaces.
  • Dashboard - Aggregate and display the results
  • CLI - Manually manage VPA creation, deletion, and provide a JSON summary.

Scope

In Scope:

  • Aggregating resource recommednations from existing sources.

Out of Scope:

  • Writing our own recommendation engine.

Architecture

Labelling

Right now, goldilocks labels all VPA objects that are created with two unique labels. These are used to keep track of the objects that it creates.

In addition, namespace labels are utilized. The label goldilocks.fairwinds.com/enabled=true is used to signify that the deployments in a namespace should be given VPAs.

Controller

The controller watches Kubernetes events for Deployments and Namespaces that have been modified, created, or deleted. When one of these is changed, the namespace that is involved is "reconciled". This means checking to see if the namespace is labelled for goldilocks usage and then making sure there is a VPA object for every deployment in that namespace. All VPA objects are set in recommendation mode only.

CLI

The cli has three main features:

  1. It can create VPA objects in a namespace for each deployment in that namespace.
  2. It can delete all the VPA objects that it created in a namespace.
  3. It can provide a JSON summary of all the existing resource limits/requests, all the VPA recommendations, and a list of the namespaces in which there are VPAs owned by goldilocks. This summary package is reused by the dashboard. In the future, this can be used to send the data somewhere else if desired.

Dashboard

The dashboard is an HTML/CSS/JS webpage that utilizes go templating to present the data generated by the summary.

Summary Package

This package looks for all VPA objects in the cluster that are owned by goldilocks and summarizes them, along with adding information about the existing deployment such as resource requests and limits.

Related Work

There are other resource-tuning efforts out there. None of them are as simple, free, or easy to use.

  • Kubecost - Requires prometheus and a bunch of other stuff (vpa has optional prometheus). Not open source entirely.
  • Spotinst - Resource tuning is not their main focus. Also not free.

Possible objections

Vertical pod autoscaler recommendations are not perfect. This could lead to some uncertainty as to the validity of the recommendations.