Skip to content

Commit

Permalink
Docusaurus/NPM dependencies upgrade (#236)
Browse files Browse the repository at this point in the history
* Fixes for MDX3 per the docusaurus-mdx-checker tool

Signed-off-by: Matt Ray <[email protected]>

* Upgraded to Docusaurus 3.4 for security warnings

Signed-off-by: Matt Ray <[email protected]>

---------

Signed-off-by: Matt Ray <[email protected]>
  • Loading branch information
mattray authored Jun 14, 2024
1 parent 4ef1b78 commit a8469c0
Show file tree
Hide file tree
Showing 13 changed files with 8,949 additions and 5,448 deletions.
4 changes: 2 additions & 2 deletions blog/2023-02-02-grafana-labs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ The above query shows the **error percentage between manual hardcoded CPU+memory

We have OpenCost deployed in every cluster in Grafana Cloud, sending to a single Grafana Mimir instance. OpenCost is designed to expect its storage having the same scope as its deployment. We deployed [prom-label-proxy](https://github.com/prometheus-community/prom-label-proxy) for filtering and subsetting, showing each OpenCost instance only the data it expects to see. Leveraging Grafana Mimir this way not only avoids the overhead of running one backend per OpenCost instance' we can also query across our whole fleet.

| [![Architecture diagram showing how each OpenCost instance does the same metrics query (i.e. without {cluster=...} label) while getting results only for the cluster where it's deployed.](./img/image2.png)](./img/image2.png) |
| [![Architecture diagram showing how each OpenCost instance does the same metrics query (i.e. without \{cluster=...\} label) while getting results only for the cluster where it's deployed.](./img/image2.png)](./img/image2.png) |
| :--: |
| *Architecture diagram showing how each OpenCost instance does the same metrics query (i.e. without {cluster=...} label) while getting results only for the cluster where it's deployed.* |
| *Architecture diagram showing how each OpenCost instance does the same metrics query (i.e. without \{cluster=...\} label) while getting results only for the cluster where it's deployed.* |


## How Grafana Labs will contribute to the OpenCost OSS project
Expand Down
2 changes: 1 addition & 1 deletion blog/2023-04-18-azure-opencost/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ The CSV format is user-friendly and allows you to archive and analyze your data

As part of the work they’re doing, Microsoft has already contributed additional patches and documentation enhancements to make OpenCost more accessible and robust. Microsoft is participating in the OpenCost community and engineering discussions and is investing their time and resources in OpenCost, we look forward to their contributions.

If you would like to get started monitoring your Kubernetes cloud spend with OpenCost, go to the [OpenCost installation instructions](https://www.opencost.io/docs/installation/install) or view the Azure blog post. The code, Helm chart, and specification are available at <https://github.com/opencost>. To get involved with the OpenCost community, join the #opencost channel in the [CNCF Slack](https://slack.cncf.io/) or subscribe to the [OpenCost community calendar](https://bit.ly/opencost-calendar) and attend the working group meetings. As OpenCost continues to gain new contributors and users there are lots of planned improvements, we welcome your patches, documentation, and feedback. We’re looking forward to working with you and the broader Azure community!
If you would like to get started monitoring your Kubernetes cloud spend with OpenCost, go to the [OpenCost installation instructions](https://www.opencost.io/docs/installation/install) or view the Azure blog post. The code, Helm chart, and specification are available at https://github.com/opencost. To get involved with the OpenCost community, join the #opencost channel in the [CNCF Slack](https://slack.cncf.io/) or subscribe to the [OpenCost community calendar](https://bit.ly/opencost-calendar) and attend the working group meetings. As OpenCost continues to gain new contributors and users there are lots of planned improvements, we welcome your patches, documentation, and feedback. We’re looking forward to working with you and the broader Azure community!
2 changes: 1 addition & 1 deletion docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ Get started with our [open source contributing guide](https://github.com/opencos

We are actively looking for new contributors if you or your company are interested in getting involved – join us using the links below-

Contact us via email (<[email protected]>), join us on [CNCF Slack](https://slack.cncf.io/) in the [#opencost](https://cloud-native.slack.com/archives/C03D56FPD4G) channel, or subscribe to the [OpenCost Community Calendar](https://bit.ly/opencost-calendar) and attend a [Community Meeting](https://bit.ly/opencost-meeting) if you have questions!
Contact us via email ([email protected]), join us on [CNCF Slack](https://slack.cncf.io/) in the [#opencost](https://cloud-native.slack.com/archives/C03D56FPD4G) channel, or subscribe to the [OpenCost Community Calendar](https://bit.ly/opencost-calendar) and attend a [Community Meeting](https://bit.ly/opencost-meeting) if you have questions!
2 changes: 1 addition & 1 deletion docs/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ OpenCost is a [CNCF Sandbox project](https://www.cncf.io/projects/opencost/) and
* [Community Meetings every other Thursday at 1pm Pacific](https://bit.ly/opencost-community-meeting-cncf)
* [Community Meeting Notes](https://bit.ly/opencost-meeting-cncf)

Contact us via email (<[email protected]>)
Contact us via email ([email protected])

## Get the Code

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ Join the [OpenCost Community](community) and follow along other community events

Join us on [CNCF Slack](https://slack.cncf.io/) in the [#opencost](https://cloud-native.slack.com/archives/C03D56FPD4G) channel if you have questions!

Contact us via email (<[email protected]>) if there's anything else you need.
Contact us via email ([email protected]) if there's anything else you need.
2 changes: 1 addition & 1 deletion docs/installation/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ If you installed with the manifest, enter the following command:

Please let us know if you run into any issues, we are here to help!

Join us on [CNCF Slack](https://slack.cncf.io/) in the [#opencost](https://cloud-native.slack.com/archives/C03D56FPD4G) channel if you have questions or contact us via email (<[email protected]>).
Join us on [CNCF Slack](https://slack.cncf.io/) in the [#opencost](https://cloud-native.slack.com/archives/C03D56FPD4G) channel if you have questions or contact us via email ([email protected]).
2 changes: 1 addition & 1 deletion docs/integrations/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ The OpenCost API is available under the [Apache 2.0 License](https://github.com/

## Theoretical error bounds

Tuning the resolution parameter allows the querier to make tradeoffs between accuracy and performance. For long-running pods (>1d) resolution can be tuned aggressively low (>10m) with relatively little effect on accuracy. However, even modestly low resolutions (5m) can result in significant accuracy degradation for short-running pods (<1h).
Tuning the resolution parameter allows the querier to make tradeoffs between accuracy and performance. For long-running pods (>1d) resolution can be tuned aggressively low (>10m) with relatively little effect on accuracy. However, even modestly low resolutions (5m) can result in significant accuracy degradation for short-running pods (\<1h).

Here, we provide theoretical error bounds for different resolution values given pods of differing running durations. The tuple represents lower- and upper-bounds for accuracy as a percentage of the actual value. For example:
- 1.00, 1.00 means that results should always be accurate to less than 0.5% error
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/opencost-exporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Here’s an example dashboard using OpenCost Prometheus metrics:

![sample dashboard](https://grafana.com/api/dashboards/8670/images/5480/image)

You can find other example dashboards at <https://grafana.com/orgs/kubecost>
You can find other example dashboards at https://grafana.com/orgs/kubecost

## Example Queries

Expand Down
141 changes: 43 additions & 98 deletions docs/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,11 @@ As Kubernetes adoption increases within an organization, these complexities beco

<table>
<tr>
<td><strong>Total Cluster Costs</strong>
</td>
<td><strong>=</strong>
</td>
<td><strong>Cluster Asset Costs</strong>
</td>
<td><strong>+</strong>
</td>
<td><strong>Cluster Overhead Costs</strong>
</td>
<td><strong>Total Cluster Costs</strong></td>
<td><strong>=</strong></td>
<td><strong>Cluster Asset Costs</strong></td>
<td><strong>+</strong></td>
<td><strong>Cluster Overhead Costs</strong></td>
</tr>
</table>

Expand All @@ -45,29 +40,13 @@ Cluster Asset Costs can be further segmented into **Resource Allocation Costs**

<table>
<tr>
<td><strong>Total Cluster Costs</strong>
</td>
<td><strong>=</strong>
</td>
<td><strong>Resource Allocation Costs</strong>
<p>
(for all assets)
</p>
</td>
<td><strong>+</strong>
</td>
<td><strong>Resource Usage Costs</strong>
<p>
(for all assets)
</p>
</td>
<td><strong>+</strong>
</td>
<td><strong>Cluster Overhead Costs</strong>
<p>
(for cluster)
</p>
</td>
<td><strong>Total Cluster Costs</strong></td>
<td><strong>=</strong></td>
<td><strong>Resource Allocation Costs</strong><p>(for all assets)</p></td>
<td><strong>+</strong></td>
<td><strong>Resource Usage Costs</strong><p>(for all assets)</p></td>
<td><strong>+</strong></td>
<td><strong>Cluster Overhead Costs</strong><p>(for cluster)</p></td>
</tr>
</table>

Expand All @@ -85,20 +64,13 @@ Once calculated, these Asset Costs can then be distributed to the tenants that c

<table>
<tr>
<td><strong>Total Cluster Costs</strong>
</td>
<td><strong>=</strong>
</td>
<td><strong>Workload Costs</strong>
</td>
<td><strong>+</strong>
</td>
<td><strong>Cluster Idle Costs</strong>
</td>
<td><strong>+</strong>
</td>
<td><strong>Cluster Overhead Costs</strong>
</td>
<td><strong>Total Cluster Costs</strong></td>
<td><strong>=</strong></td>
<td><strong>Workload Costs</strong></td>
<td><strong>+</strong></td>
<td><strong>Cluster Idle Costs</strong></td>
<td><strong>+</strong></td>
<td><strong>Cluster Overhead Costs</strong></td>
</tr>
</table>

Expand Down Expand Up @@ -170,46 +142,32 @@ Workloads are defined as entities to which Asset Costs are committed. Some resou

<table>
<tr>
<td>Resource Type
</td>
<td>Measurement
</td>
<td>Resource Type</td>
<td>Measurement</td>
</tr>
<tr>
<td>CPU
</td>
<td>The greater of <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-requests-and-limits-of-pod-and-container">requested</a> and used CPU resources measured in cores or millicores.
</td>
<td>CPU</td>
<td>The greater of <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-requests-and-limits-of-pod-and-container">requested</a> and used CPU resources measured in cores or millicores.</td>
</tr>
<tr>
<td>Memory
</td>
<td>The greater of requested resources and memory in use measured in bytes or gigabytes.
</td>
<td>Memory</td>
<td>The greater of requested resources and memory in use measured in bytes or gigabytes.</td>
</tr>
<tr>
<td>GPU
</td>
<td>The greater of requested resources and used resources measured in cores.
</td>
<td>GPU</td>
<td>The greater of requested resources and used resources measured in cores.</td>
</tr>
<tr>
<td>Storage Volume
</td>
<td>The storage capacity of Persistent Volume Claim (PVC) requests measured in bytes or gigabytes. Attached at the Kubernetes pod-level.
</td>
<td>Storage Volume</td>
<td>The storage capacity of Persistent Volume Claim (PVC) requests measured in bytes or gigabytes. Attached at the Kubernetes pod-level.</td>
</tr>
<tr>
<td>Network
</td>
<td>Amount of ingress or egress across zones, regions, or the wide internet measured in bytes or gigabytes (can vary by provider)
</td>
<td>Network</td>
<td>Amount of ingress or egress across zones, regions, or the wide internet measured in bytes or gigabytes (can vary by provider)</td>
</tr>
<tr>
<td>Load Balancer
</td>
<td>The number of load balancers used plus the volume of connections and bytes (can vary by provider).
</td>
<td>Load Balancer</td>
<td>The number of load balancers used plus the volume of connections and bytes (can vary by provider).</td>
</tr>
</table>

Expand Down Expand Up @@ -247,36 +205,23 @@ Idle Costs can be calculated at both the Asset/Resource level as well as the Wor

<table>
<tr>
<td><strong>Cluster Idle Cost</strong>
</td>
<td><strong>=</strong>
</td>
<td><strong>( Cluster Asset Costs</strong>
</td>
<td><strong>-</strong>
</td>
<td><strong>Workload Costs )</strong>
</td>
<td><strong>Cluster Idle Cost</strong></td>
<td><strong>=</strong></td>
<td><strong>( Cluster Asset Costs</strong></td>
<td><strong>-</strong></td>
<td><strong>Workload Costs )</strong></td>
</tr>
</table>



<table>
<tr>
<td><strong>Cluster </strong>
<p>
<strong>Idle %</strong>
</p>
</td>
<td><strong>=</strong>
</td>
<td><strong>Idle Cost</strong>
</td>
<td><strong>/</strong>
</td>
<td><strong>Resource Allocation Costs</strong>
</td>
<td><strong>Cluster </strong><p><strong>Idle %</strong></p></td>
<td><strong>=</strong></td>
<td><strong>Idle Cost</strong></td>
<td><strong>/</strong></td>
<td><strong>Resource Allocation Costs</strong></td>
</tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ helm upgrade prometheus --repo https://prometheus-community.github.io/helm-chart
Please let us know if you run into any issues, we are here to help!
Join us on [CNCF Slack](https://slack.cncf.io/) in the [#opencost](https://cloud-native.slack.com/archives/C03D56FPD4G) channel if you have questions or contact us via email (<[email protected]>).
Join us on [CNCF Slack](https://slack.cncf.io/) in the [#opencost](https://cloud-native.slack.com/archives/C03D56FPD4G) channel if you have questions or contact us via email ([email protected]).
7 changes: 3 additions & 4 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
import {themes as prismThemes} from 'prism-react-renderer';

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -141,8 +140,8 @@ const config = {
copyright: `Copyright © ${new Date().getFullYear()} OpenCost`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
}),
};
Expand Down
Loading

0 comments on commit a8469c0

Please sign in to comment.