Automated rightsizing with CostGraph
CostGraph Operator is a Kubernetes operator that automates the process of rightsizing your Kubernetes workloads.We do not enable this feature across all your workloads by default. You must specify this on a workload-by-workload basis.
Patching Strategy
For now, we do not support backfilling the recommendations from the cluster to other sources. We may support this in the future.
Annotations
| Annotation Name | Key | Description | Example Value |
|---|---|---|---|
| AnnotationEnable | costgraph.baselinehq.cloud/enable-rightsizing | Enables rightsizing for the resource | ”true” |
| AnnotationPlan | costgraph.baselinehq.cloud/rightsizing-plan | Rightsizing plan identifier | ”p99” |
| AnnotationLastHash | costgraph.baselinehq.cloud/rightsizing-hash | Hash of the last applied rightsizing plan (readonly) | “abc123” |
| AnnotationLastUpdate | costgraph.baselinehq.cloud/rightsizing-last-update | Timestamp of the last rightsizing update (readonly) | “2024-06-01T12:00:00Z” |
| AnnotationCPURequestRange | costgraph.baselinehq.cloud/rightsizing-cpu-request-range | Allowed CPU request range (cores) | “1,5” |
| AnnotationCPULimitRange | costgraph.baselinehq.cloud/rightsizing-cpu-limit-range | Allowed CPU limit range (cores) | “2,10” |
| AnnotationMemoryRequestRange | costgraph.baselinehq.cloud/rightsizing-memory-request-range | Allowed memory request range (GiB) | “0.1,1” |
| AnnotationMemoryLimitRange | costgraph.baselinehq.cloud/rightsizing-memory-limit-range | Allowed memory limit range (GiB) | “0.5,2” |
Ranges for recommendation values
As part of the rightsizing process, customers can specify an override range for the recommendations to allow for a minimum and maximum value. This is configured using theAnnotation(CPU|Memory)(Request|Limit)Range fields and is specified as a comma-separated list of values in the format min,max with floats on absolute values for the resource.
For example, to allow a CPU request minimum of 100m cores and a maximum of 200m cores, you would specify costgraph.baselinehq.cloud/rightsizing-cpu-request-range : "0.1,0.2".
Allowed fields for the plan annotation
Our operator takes a non-conventional approach to recommendations by performing the audits on a node-by-node basis. This allows you to define control of the recommendations and the auditing process. As part of the rightsizing process, you can specify a plan which clarifies how the range of values obtained on a per-node audit can be used to determine the right size of the workload. We allow percentile and arithmetic aggregates to perform this operation:- mean, avg
- p50, median
- p90
- p95
- p100, max
- p99
Configuring the recommended values
The operator by default uses the same values as the recommended source in the usage data. Therefore, if you want a wider or smaller gap from usage to recommendation, tune theexpected_utilisation_percent field in the configuration.