summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPavan Gudiwada <25551553+pavangudiwada@users.noreply.github.com>2024-01-12 14:01:28 +0530
committerGitHub <noreply@github.com>2024-01-12 14:01:28 +0530
commit2e7fab66ba31675d9754e9cc9adec7199188091f (patch)
tree12070b03408d6316943598cf47bef82e8be8b44a /README.md
parente575f240eef127bde5826c0c1987374caf7f80e3 (diff)
parent648421205c4482d2a884f35fdb32525b52736278 (diff)
Merge pull request #189 from robusta-dev/updateReadme-integrations
Update readme integrations
Diffstat (limited to 'README.md')
-rw-r--r--README.md187
1 files changed, 121 insertions, 66 deletions
diff --git a/README.md b/README.md
index eb9c9e9..183471e 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,20 @@
Robusta KRR (Kubernetes Resource Recommender) is a CLI tool for optimizing resource allocation in Kubernetes clusters. It gathers pod usage data from Prometheus and recommends requests and limits for CPU and memory. This reduces costs and improves performance.
-_Supports: [Prometheus](#prometheus-victoria-metrics-and-thanos-auto-discovery), [Thanos](#prometheus-victoria-metrics-and-thanos-auto-discovery), [Victoria Metrics](#prometheus-victoria-metrics-and-thanos-auto-discovery), [Google Managed Prometheus](./docs/google-cloud-managed-service-for-prometheus.md), [Amazon Managed Prometheus](#amazon-managed-prometheus), [Azure Managed Prometheus](#azure-managed-prometheus), [Coralogix](#coralogix-managed-prometheus) and [Grafana Cloud](#grafana-cloud-managed-prometheus)_
+### Data Integrations
+
+[![Used to send data to KRR](./images/krr-datasources.svg)](#data-source-integrations)
+
+
+_View Instructions for: [Prometheus](#prometheus-victoria-metrics-and-thanos-auto-discovery), [Thanos](#prometheus-victoria-metrics-and-thanos-auto-discovery), [Victoria Metrics](#prometheus-victoria-metrics-and-thanos-auto-discovery), [Google Managed Prometheus](./docs/google-cloud-managed-service-for-prometheus.md), [Amazon Managed Prometheus](#amazon-managed-prometheus), [Azure Managed Prometheus](#azure-managed-prometheus), [Coralogix](#coralogix-managed-prometheus) and [Grafana Cloud](#grafana-cloud-managed-prometheus)_
+
+
+
+### Reporting Integrations
+
+[![Used to receive information from KRR](./images/krr-other-integrations.svg)](#integrations)
+
+_View instructions for: [Seeing recommendations in a UI](#free-ui-for-krr-recommendations), [Sending recommendations to Slack](#slack-notification), [Setting up KRR as a k9s plugin](#k9s-plugin)_
### Features
@@ -90,10 +103,14 @@ Read more about [how KRR works](#how-krr-works) and [KRR vs Kubernetes VPA](#dif
### Requirements
-KRR requires you to have Prometheus.
+KRR requires Prometheus and [kube-state-metrics](https://github.com/kubernetes/kube-state-metrics).
-Additionally to that, [kube-state-metrics](https://github.com/kubernetes/kube-state-metrics) needs to be running on your cluster, as KRR is dependant on those metrics:
+<details>
+ <summary>Which metrics does KRR need?</summary>
+No setup is required if you use kube-prometheus-stack or <a href="https://docs.robusta.dev/master/configuration/alertmanager-integration/embedded-prometheus.html">Robusta's Embedded Prometheus</a>.
+If you have a different setup, make sure the following metrics exist:
+
- `container_cpu_usage_seconds_total`
- `container_memory_working_set_bytes`
- `kube_replicaset_owner`
@@ -101,6 +118,7 @@ Additionally to that, [kube-state-metrics](https://github.com/kubernetes/kube-st
- `kube_pod_status_phase`
_Note: If one of last three metrics is absent KRR will still work, but it will only consider currently-running pods when calculating recommendations. Historic pods that no longer exist in the cluster will not be taken into consideration._
+</details>
### Installation Methods
@@ -194,7 +212,7 @@ Most helpful flags:
- `--cpu-min` Sets the minimum recommended cpu value in millicores
- `--mem-min` Sets the minimum recommended memory value in MB
-- `--history_duration` The duration of the prometheus history data to use (in hours)
+- `--history_duration` The duration of the Prometheus history data to use (in hours)
More specific information on Strategy Settings can be found using
@@ -206,7 +224,7 @@ krr simple --help
<details>
<summary>Giving an Explicit Prometheus URL</summary>
-If your prometheus is not auto-connecting, you can use `kubectl port-forward` for manually forwarding Prometheus.
+If your Prometheus is not auto-connecting, you can use `kubectl port-forward` for manually forwarding Prometheus.
For example, if you have a Prometheus Pod called `kube-prometheus-st-prometheus-0`, then run this command to port-forward it:
@@ -214,7 +232,7 @@ For example, if you have a Prometheus Pod called `kube-prometheus-st-prometheus-
kubectl port-forward pod/kube-prometheus-st-prometheus-0 9090
```
-Then, open another terminal and run krr in it, giving an explicit prometheus url:
+Then, open another terminal and run krr in it, giving an explicit Prometheus url:
```sh
krr simple -p http://127.0.0.1:9090
@@ -299,18 +317,6 @@ krr simple -v
<p align="right">(<a href="#readme-top">back to top</a>)</p>
-## Optional: Free SaaS Platform
-
-With the [free Robusta SaaS platform](https://home.robusta.dev/) you can:
-
-- See why KRR recommends what it does
-- Sort and filter recommendations by namespace, priority, and more
-- Copy a YAML snippet to fix the problems KRR finds
-
-![Robusta UI Screen Shot][ui-screenshot]
-
-<p align="right">(<a href="#readme-top">back to top</a>)</p>
-
## How KRR works
### Metrics Gathering
@@ -343,7 +349,7 @@ By default, we use a _simple_ strategy to calculate resource recommendations. It
### Prometheus connection
-Find about how KRR tries to find the default prometheus to connect <a href="#prometheus-victoria-metrics-and-thanos-auto-discovery">here</a>.
+Find about how KRR tries to find the default Prometheus to connect <a href="#prometheus-victoria-metrics-and-thanos-auto-discovery">here</a>.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
@@ -364,47 +370,14 @@ Find about how KRR tries to find the default prometheus to connect <a href="#pro
<!-- ADVANCED USAGE EXAMPLES -->
-## Slack integration
-Put cost savings on autopilot. Get notified in Slack about recommendations above X%. Send a weekly global report, or one report per team.
-![Slack Screen Shot][slack-screenshot]
-### Prerequisites
-
-- A Slack workspace
-
-### Setup
-
-1. [Install Robusta with Helm to your cluster and configure slack](https://docs.robusta.dev/master/installation.html)
-2. Create your KRR slack playbook by adding the following to `generated_values.yaml`:
-
-```
-customPlaybooks:
-# Runs a weekly krr scan on the namespace devs-namespace and sends it to the configured slack channel
-customPlaybooks:
-- triggers:
- - on_schedule:
- fixed_delay_repeat:
- repeat: -1 # number of times to run or -1 to run forever
- seconds_delay: 604800 # 1 week
- actions:
- - krr_scan:
- args: "--namespace devs-namespace" ## KRR args here
- sinks:
- - "main_slack_sink" # slack sink you want to send the report to here
-```
-
-3. Do a Helm upgrade to apply the new values: `helm upgrade robusta robusta/robusta --values=generated_values.yaml --set clusterName=<YOUR_CLUSTER_NAME>`
-
-<p align="right">(<a href="#readme-top">back to top</a>)</p>
-
-<!-- Port-forwarding -->
-
-## Prometheus, Victoria Metrics and Thanos auto-discovery
+## Data Source Integrations
+<details id="prometheus-victoria-metrics-and-thanos-auto-discovery"><summary> Prometheus, Victoria Metrics and Thanos auto-discovery</summary>
By default, KRR will try to auto-discover the running Prometheus Victoria Metrics and Thanos.
-For discovering prometheus it scan services for those labels:
+For discovering Prometheus it scans services for those labels:
```python
"app=kube-prometheus-stack-prometheus"
@@ -438,7 +411,11 @@ If none of those labels result in finding Prometheus, Victoria Metrics or Thanos
<p align="right">(<a href="#readme-top">back to top</a>)</p>
-## Scanning with a Centralized Prometheus
+</details>
+
+<details id="scanning-with-a-centralized-prometheus">
+<summary>Scanning with a Centralized Prometheus</summary>
+
If your Prometheus monitors multiple clusters we require the label you defined for your cluster in Prometheus.
For example, if your cluster has the Prometheus label `cluster: "my-cluster-name"`, then run this command:
@@ -449,7 +426,11 @@ krr.py simple --prometheus-label cluster -l my-cluster-name
You may also need the `-p` flag to explicitly give Prometheus' URL.
-## Azure Managed Prometheus
+</details>
+
+
+<details id="azure-managed-prometheus">
+<summary>Azure Managed Prometheus</summary>
For Azure managed Prometheus you need to generate an access token, which can be done by running the following command:
@@ -469,9 +450,13 @@ python krr.py simple --namespace default -p PROMETHEUS_URL --prometheus-auth-hea
<p align="right">(<a href="#readme-top">back to top</a>)</p>
-## Amazon Managed Prometheus
+</details>
-For Amazon Managed Prometheus you need to add your prometheus link and the flag --eks-managed-prom and krr will automatically use your aws credentials
+
+<details id="amazon-managed-prometheus">
+<summary>Amazon Managed Prometheus</summary>
+
+For Amazon Managed Prometheus you need to add your Prometheus link and the flag --eks-managed-prom and krr will automatically use your aws credentials
```sh
python krr.py simple -p "https://aps-workspaces.REGION.amazonaws.com/workspaces/..." --eks-managed-prom
@@ -484,16 +469,19 @@ Additional optional parameters are:
--eks-access-key ACCESS_KEY # to specify your access key
--eks-secret-key SECRET_KEY # to specify your secret key
--eks-service-name SERVICE_NAME # to use a specific service name in the signature
---eks-managed-prom-region REGION_NAME # to specify the region the prometheus is in
+--eks-managed-prom-region REGION_NAME # to specify the region the Prometheus is in
```
<p ><a href="#scanning-with-a-centralized-prometheus">See here about configuring labels for centralized prometheus</a></p>
<p align="right">(<a href="#readme-top">back to top</a>)</p>
+</details>
+
-## Coralogix Managed Prometheus
+<details id="coralogix-managed-prometheus">
+<summary>Coralogix Managed Prometheus</summary>
-For Coralogix managed Prometheus you need to specify your prometheus link and add the flag coralogix_token with your Logs Query Key
+For Coralogix managed Prometheus you need to specify your Prometheus link and add the flag coralogix_token with your Logs Query Key
```sh
python krr.py simple -p "https://prom-api.coralogix..." --coralogix_token
@@ -502,12 +490,14 @@ python krr.py simple -p "https://prom-api.coralogix..." --coralogix_token
<p ><a href="#scanning-with-a-centralized-prometheus">See here about configuring labels for centralized prometheus</a></p>
<p align="right">(<a href="#readme-top">back to top</a>)</p>
+</details>
-## Grafana Cloud Managed Prometheus
+<details id="grafana-cloud-managed-prometheus">
+<summary>Grafana Cloud Managed Prometheus</summary>
-For Grafana Cloud managed Prometheus you need to specify prometheus link, prometheus user, and an access token of your Grafana Cloud stack. The Prometheus link and user for the stack can be found on the Grafana Cloud Portal. An access token with a `metrics:read` scope can also be created using Access Policies on the same portal.
+For Grafana Cloud managed Prometheus you need to specify Prometheus link, Prometheus user, and an access token of your Grafana Cloud stack. The Prometheus link and user for the stack can be found on the Grafana Cloud Portal. An access token with a `metrics:read` scope can also be created using Access Policies on the same portal.
-Next, run the following command, after setting the values of PROM_URL, PROM_USER, and PROM_TOKEN variables with your Grafana Cloud stack's prometheus link, prometheus user, and access token.
+Next, run the following command, after setting the values of PROM_URL, PROM_USER, and PROM_TOKEN variables with your Grafana Cloud stack's Prometheus link, Prometheus user, and access token.
```sh
python krr.py simple -p $PROM_URL --prometheus-auth-header "Bearer ${PROM_USER}:${PROM_TOKEN}" --prometheus-ssl-enabled
@@ -517,7 +507,72 @@ python krr.py simple -p $PROM_URL --prometheus-auth-header "Bearer ${PROM_USER}:
<p align="right">(<a href="#readme-top">back to top</a>)</p>
-<!-- CUSTOM -->
+</details>
+</p>
+
+## Integrations
+
+<details id="free-ui-for-krr-recommendations">
+<summary>Free UI for KRR recommendations</summary>
+
+With the [free Robusta SaaS platform](https://home.robusta.dev/) you can:
+
+- See why KRR recommends what it does
+- Sort and filter recommendations by namespace, priority, and more
+- Copy a YAML snippet to fix the problems KRR finds
+
+![Robusta UI Screen Shot][ui-screenshot]
+
+</details>
+
+<details id="slack-notification">
+<summary>Slack Notification</summary>
+
+Put cost savings on autopilot. Get notified in Slack about recommendations above X%. Send a weekly global report, or one report per team.
+
+![Slack Screen Shot][slack-screenshot]
+
+### Prerequisites
+
+- A Slack workspace
+
+### Setup
+
+1. [Install Robusta with Helm to your cluster and configure slack](https://docs.robusta.dev/master/installation.html)
+2. Create your KRR slack playbook by adding the following to `generated_values.yaml`:
+
+```
+customPlaybooks:
+# Runs a weekly krr scan on the namespace devs-namespace and sends it to the configured slack channel
+customPlaybooks:
+- triggers:
+ - on_schedule:
+ fixed_delay_repeat:
+ repeat: -1 # number of times to run or -1 to run forever
+ seconds_delay: 604800 # 1 week
+ actions:
+ - krr_scan:
+ args: "--namespace devs-namespace" ## KRR args here
+ sinks:
+ - "main_slack_sink" # slack sink you want to send the report to here
+```
+
+3. Do a Helm upgrade to apply the new values: `helm upgrade robusta robusta/robusta --values=generated_values.yaml --set clusterName=<YOUR_CLUSTER_NAME>`
+
+
+<p align="right">(<a href="#readme-top">back to top</a>)</p>
+
+</details>
+
+<details id="k9s-plugin">
+<summary>k9s Plugin</summary>
+
+ Install our k9s Plugin to get recommendations directly in deployments/daemonsets/statefulsets views.
+
+ Plugin: [resource recommender](https://github.com/derailed/k9s/blob/master/plugins/resource-recommendations.yaml)
+
+ Installation instructions: [k9s docs](https://k9scli.io/topics/plugins/)
+</details>
## Creating a Custom Strategy/Formatter