Skip to content

Commit

Permalink
chore: improve cost control platform docs
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Zaniewski <[email protected]>
  • Loading branch information
Piotr1215 committed Dec 11, 2024
1 parent ca14568 commit 015a435
Showing 1 changed file with 49 additions and 30 deletions.
79 changes: 49 additions & 30 deletions platform/configure/cost-control.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,56 @@
title: Cost Control Dashboard
sidebar_label: Cost Control
sidebar_position: 6
description: Learn how to configure the Cost Control Dashboard and it's supporting infrastructure.
description: Learn how to configure the Cost Control Dashboard and its supporting infrastructure for the vCluster Platform.
---

By default, the platform comes with the cost control dashboard enabled, which offers insights into potential cost
savings by leveraging virtual clusters.
import VersionBadge from '@site/src/components/VersionBadge';

In order to track allocations and calculate savings for workloads running inside
virtual clusters the platform deploys and manages [Prometheus](https://prometheus.io/) and
[OpenCost](https://www.opencost.io/) on each connected cluster. Prometheus is backed by a time series database that
requires persistent volume storage in order to retain metrics over time. The platform managed Prometheus is configured to
collect the minimum metrics required for the cost control dashboard. OpenCost provides CPU and Memory allocation metrics
for the deployed workloads.
The platform comes with the cost control dashboard enabled by default, offering insights into potential [cost savings](https://www.vcluster.com/cost-savings) through virtual clusters.

<VersionBadge version="v4.2.0" vclusterVersion="v0.22.0"/>

In addition to the connected cluster Prometheus, the cluster hosting the platform will have a global Prometheus
To track allocations and calculate savings for workloads running inside
virtual clusters the platform deploys and manages [Prometheus](https://prometheus.io/) and
[OpenCost](https://www.opencost.io/) on each connected cluster. Prometheus uses a time series database that requires
persistent volume storage to retain metrics over time. The platform-managed
Prometheus is configured to collect the minimum metrics required for the cost
control dashboard. OpenCost provides CPU and Memory allocation metrics for the
deployed workloads.

In addition to the Prometheus instance on the connected cluster, the cluster
hosting the platform has a global Prometheus
installed that is configured to aggregate metrics from all connected clusters. This utilizes the connected cluster private
network so no additional networking configuration is required.

:::warning Storage Requirements
By default, the Cost Control Dashboard will request 60Gi persistent volumes for each connected cluster's metrics, and an
additional 60Gi persistent volume for global metric aggregation. See the [Configuration](#configuration) section for
details on enabling / disabling the dashboard or configuring its resource needs.
:::warning Storage requirements
By default, the Cost Control Dashboard requests
60Gi persistent volumes for each connected cluster's metrics, and an additional
60Gi persistent volume for global metric aggregation. See the
[Configuration](#configuration) section for details on enabling/disabling the
dashboard or configuring its resource needs.
:::

## Configuration
Even though the platform manages Prometheus and OpenCost automatically, there are settings that can be configured to
better suite your specific environments or needs. The primary configuration is part of the [platform config](https://www.vcluster.com/docs/platform/configure/config)
under `costControl`.

Since the cost control dashboard is enabled by default, it must be explicitly disabled by setting `costControl.enabled` to `false`:
```yaml title="Disabling the Cost Control Dashboard"
Although the platform manages Prometheus and OpenCost automatically, certain
settings can be configured to better suit specific environments or needs. The
primary configuration is part of the [platform `constControl`
config](/platform/configure/cost-control).


To turn off the cost control dashboard, which is enabled by default, set `costControl.enabled` to `false`:

```yaml title="Turning off the Cost Control Dashboard"
config:
costControl:
enabled: false
```
The remaining configuration is to customize the cost settings, the global Prometheus, and the connected cluster OpenCost
and Prometheus. These are detailed in the next few sections.
The remaining configuration customizes the cost settings, global Prometheus, and connected cluster OpenCost and Prometheus. These are detailed in the following sections.
### Cost settings
### Cost Settings
The platform provides initial cost defaults as shown below. These can be customized for your environment.
```yaml title="Default Cost Settings"
config:
Expand All @@ -60,9 +71,12 @@ config:
timePeriod: Yearly
```
### Global Prometheus Configuration
These settings control the global Prometheus's availability, retention, storage, cpu and memory configuration. The
### Global observability
These settings control, the global Prometheus's availability, retention,
storage, cpu, and memory configuration. The
default settings are provided below for reference, and may be customized.
```yaml title="Default Global Prometheus Settings"
config:
costControl:
Expand Down Expand Up @@ -96,17 +110,20 @@ config:
`storageClass` configures the storage class that should be used for provisioning of the Prometheus deployment's
`StatefulSet`. Valid values are:
- `null`: use the cluster's default storage class
- `""` (empty string): disable automatic provisioning
- The name of a preconfigured storage class on the cluster
- `""` (empty string): turn off automatic provisioning
- The name of a pre-configured storage class on the cluster

:::warning Overriding Resources
Overridden `resources` are not merged with the defaults to avoid unexpected changes from Helm charts used by the
platform to manage Prometheus. Therefore, all requests and limits that you wish to apply should be provided.
:::

### Cluster Prometheus Configuration
These settings control the Prometheus's configuration for each connected cluster. These will be applied uniformly
### Cluster observability

These settings control the Prometheus's configuration for each connected
cluster. These are applied uniformly
across multiple clusters, but can be customized using [Cluster Specific Configuration](#cluster-specific-configuration).

```yaml title="Default Cluster Prometheus Settings"
config:
costControl:
Expand Down Expand Up @@ -139,7 +156,8 @@ Overridden `resources` are not merged with the defaults to avoid unexpected chan
platform to manage Prometheus. Therefore, all requests and limits that you wish to apply should be provided.
:::

### Cluster OpenCost Configuration
### Cluster cost control

These settings control the OpenCost deployment on each connected cluster. While there are many possible ways to
configure OpenCost, the Platform configures it with the minimum settings required for the dashboard. As such only
availability, CPU, and memory settings may be configured.
Expand Down Expand Up @@ -167,6 +185,7 @@ platform to manage OpenCost. Therefore, all requests and limits that you wish to
:::


### Cluster Specific Configuration
### Other cluster settings

For individual cluster configuration, the [Cluster](/platform/api/resources/clusters) resource allows for further
configuration specific to each cluster.

0 comments on commit 015a435

Please sign in to comment.