Skip to content

Commit

Permalink
chore(docs): use autogenerate for site (#672)
Browse files Browse the repository at this point in the history
# Description

As title. Also rearranged some docs around.
## Related Issue

If this pull request is related to any issue, please mention it here.
Additionally, make sure that the issue is assigned to you before
submitting this pull request.

## Checklist

- [x] I have read the [contributing
documentation](https://retina.sh/docs/contributing).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.

## Screenshots (if applicable) or Testing Completed

Please add any relevant screenshots or GIFs to showcase the changes
made.

## Additional Notes

Add any additional notes or context about the pull request here.

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.
  • Loading branch information
nddq authored Aug 27, 2024
1 parent df20875 commit f77b2b4
Show file tree
Hide file tree
Showing 55 changed files with 82 additions and 186 deletions.
6 changes: 3 additions & 3 deletions docs/intro.md → docs/01-Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ With Retina, you can **automate this process** with a **single CLI command** or
- Run captures on all Nodes hosting the Pods of interest.
- Upload each Node's results to a storage blob.

To begin using the CLI, see [Quick Start Installation](./installation/cli.md).
To begin using the CLI, see [Quick Start Installation](./02-Installation/02-CLI.md).

### Monitoring Network Health

Expand Down Expand Up @@ -59,13 +59,13 @@ Retina provides both:
- **Basic metrics** (default, Node-Level metrics) and
- **Advanced/Pod-Level metrics** (if enabled).

For more info and a list of metrics, see [Metrics](metrics/modes.md).
For more info and a list of metrics, see [Metrics](03-Metrics/modes/modes.md).

### Captures

A Retina capture **logs network traffic** and metadata **for the specified Nodes/Pods**.

Captures are **on-demand** and can be output to multiple destinations. For more info, see [Captures](captures/readme.md).
Captures are **on-demand** and can be output to multiple destinations. For more info, see [Captures](04-Captures/readme.md).

## Extendable Architecture

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Install the helm chart below for your scenario.

Note: you can also run captures with just the [CLI](./cli.md).
Note: you can also run captures with just the [CLI](./02-CLI.md).

## Installation

Expand Down Expand Up @@ -42,7 +42,7 @@ helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \

### Advanced Mode with Remote Context (with Capture support)

See [Metric Modes](../metrics/modes.md).
See [Metric Modes](../03-Metrics/modes/modes.md).

```shell
VERSION=$( curl -sL https://api.github.com/repos/microsoft/retina/releases/latest | jq -r .name)
Expand All @@ -64,7 +64,7 @@ helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \

### Advanced Mode with Local Context (with Capture support)

See [Metric Modes](../metrics/modes.md).
See [Metric Modes](../03-Metrics/modes/modes.md).

```shell
VERSION=$( curl -sL https://api.github.com/repos/microsoft/retina/releases/latest | jq -r .name)
Expand All @@ -86,4 +86,4 @@ helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \

## Next Steps: Configuring Prometheus/Grafana

- [Unmanaged Prometheus/Grafana](./prometheus-unmanaged.md)
- [Unmanaged Prometheus/Grafana](./04-Grafana/prometheus-unmanaged.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Currently, Retina CLI supports Linux, Windows, and MacOS on x86_64 and ARM64 platforms.

For CLI usage, see [Capture with Retina CLI](../captures/cli.md).
For CLI usage, see [Capture with Retina CLI](../04-Captures/cli.md).

## Option 1: Install using Krew

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Defaults are specified for each component in *deploy/legacy/manifests/controller
* `enabledPlugin_linux`: Array of enabled plugins for linux.
* `enabledPlugin_win`: Array of enabled plugins for windows.
* `metricsInterval`: the interval for which metrics will be gathered.
* `dataAggregationLevel`: This config defines the level of data aggregation for Retina. See [Data Aggregation](../concepts/dataAggregation.md) for more details.
* `dataAggregationLevel`: This config defines the level of data aggregation for Retina. See [Data Aggregation](../05-Concepts/data-aggregation.md) for more details.

## Operator Config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ Port-forward svc/prometheus-grafana to access from local browser.

1. Check Grafana to make sure the managed Prometheus datasource exists:

![alt text](img/portal-grafana.png)
![alt text](../img/portal-grafana.png)

2. Go to the dashboard page and select "import":

![alt text](img/grafana-dashboard-import.png)
![alt text](../img/grafana-dashboard-import.png)

3. Import the [published dashboards](https://grafana.com/grafana/dashboards/) by ID [18814](https://grafana.com/grafana/dashboards/18814-kubernetes-networking-clusters/)

4. The Grafana dashboard should now be visible.

![alt text](img/grafana-dashboard.png)
![alt text](../img/grafana-dashboard.png)

## Pre-Installed Dashboards

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Pre-Requisites

1. Create a Kubernetes cluster.
2. Install Retina DaemonSet (see [Quick Installation](./setup.md)).
2. Install Retina DaemonSet (see [Quick Installation](../01-Setup.md)).

## Configuring Prometheus

Expand Down Expand Up @@ -39,7 +39,7 @@ Note: Grafana and kube-state metrics may schedule on Windows nodes, the current
7. Then go to [http://localhost:9090/targets](http://localhost:9090/targets) to see the Retina Pods being discovered and scraped:
![alt text](img/prometheus-retina-pods.png)
![alt text](../img/prometheus-retina-pods.png)
## Configuring Grafana
Expand All @@ -55,4 +55,4 @@ kubectl get secret -n kube-system prometheus-grafana -o jsonpath="{.data.admin-p
10. Metrics should be visible:
![alt text](img/grafana-dashboard-metrics.png)
![alt text](../img/grafana-dashboard-metrics.png)
File renamed without changes.
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Annotations

Annotations let you specify which Pods to observe (create metrics for).
To configure this, specify `enableAnnotations=true` in Retina's [helm installation](../installation/setup.md) or [ConfigMap](../installation/config.md).
To configure this, specify `enableAnnotations=true` in Retina's [helm installation](../02-Installation/01-Setup.md) or [ConfigMap](../02-Installation/03-Config.md).

You can then add the annotation `retina.sh: observe` to either:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Metrics Configuration

You can enable/disable metrics by including/omitting their Plugin from `enabledPlugins` in either Retina's [helm installation](../installation/setup.md) or [ConfigMap](../installation/config.md).
You can enable/disable metrics by including/omitting their Plugin from `enabledPlugins` in either Retina's [helm installation](../02-Installation/01-Setup.md) or [ConfigMap](../02-Installation/03-Config.md).

Via [MetricsConfiguration CRD](../CRDs/MetricsConfiguration.md), you can further customize the following for your enabled plugins:
Via [MetricsConfiguration CRD](../05-Concepts/CRDs/MetricsConfiguration.md), you can further customize the following for your enabled plugins:

- Which metrics to include
- Which metadata to include for a metric.
12 changes: 6 additions & 6 deletions docs/metrics/advanced.md → docs/03-Metrics/modes/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
There are two Advanced modes (see [Metric Modes](./modes.md)) which include all [Basic Metrics](./basic.md) plus extra metrics providing Pod-Level context.

The two Advanced modes are *remote context* and *local context*. The difference lies in the [Context Labels](#context-labels).
Additionally, *local context* supports [Annotations](./annotations.md).
Additionally, *local context* supports [Annotations](../annotations.md).

## Prefix

Expand All @@ -20,7 +20,7 @@ Node and Cluster metadata are included with the labels:

There are Pod-Level context labels for metrics prepended with `adv_`.

To customize context labels, see [MetricsConfiguration CRD](../CRDs/MetricsConfiguration.md).
To customize context labels, see [MetricsConfiguration CRD](../../05-Concepts/CRDs/MetricsConfiguration.md).

### Remote Context

Expand Down Expand Up @@ -59,7 +59,7 @@ For *incoming* traffic:

### Plugin: `dropreason` (Linux)

Metrics enabled when `dropreason` plugin is enabled (see [Metrics Configuration](./configuration.md)).
Metrics enabled when `dropreason` plugin is enabled (see [Metrics Configuration](../configuration.md)).

| Metric Name | Description | Extra Labels |
| ----------------------- | ---------------------------------------------- | --------------------- |
Expand Down Expand Up @@ -93,7 +93,7 @@ Possible values for `reason`:

### Plugin: `dns` (Linux)

Metrics enabled when `dns` plugin is enabled (see [Metrics Configuration](./configuration.md)).
Metrics enabled when `dns` plugin is enabled (see [Metrics Configuration](../configuration.md)).

| Metric Name | Description | Extra Labels |
| ---------------------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
Expand All @@ -108,7 +108,7 @@ Metrics enabled when `dns` plugin is enabled (see [Metrics Configuration](./conf

### Plugin: `packetparser` (Linux)

Metrics enabled when `packetparser` plugin is enabled (see [Metrics Configuration](./configuration.md)).
Metrics enabled when `packetparser` plugin is enabled (see [Metrics Configuration](../configuration.md)).

| Metric Name | Description | Extra Labels |
| ------------------------------------------ | ----------------------------------------------------------------------------- | --------------------------- |
Expand Down Expand Up @@ -152,7 +152,7 @@ Possible values for `le` (for API server metrics). Units are in *milliseconds*.

### Plugin: `tcpretrans` (Linux)

Metrics enabled when `tcpretrans` plugin is enabled (see [Metrics Configuration](./configuration.md)).
Metrics enabled when `tcpretrans` plugin is enabled (see [Metrics Configuration](../configuration.md)).

| Metric Name | Description | Extra Labels |
| ---------------------- | -------------------------------------------------------- | -------------- |
Expand Down
15 changes: 9 additions & 6 deletions docs/metrics/basic.md → docs/03-Metrics/modes/basic.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
sidebar_position: 2
---
# Basic Metrics

These metrics are provided in all three modes (see [Metric Modes](./modes.md)).
Expand All @@ -17,7 +20,7 @@ All metrics include node and Cluster metadata with the labels:

### Plugin: `packetforward` (Linux)

Metrics enabled when `packetforward` plugin is enabled (see [Metrics Configuration](./configuration.md)).
Metrics enabled when `packetforward` plugin is enabled (see [Metrics Configuration](../configuration.md)).

| Name | Description | Extra Labels |
| ----------------------- | ----------------------- | ------------- |
Expand All @@ -33,7 +36,7 @@ Possible values for `direction`:

### Plugin: `dropreason` (Linux)

Metrics enabled when `dropreason` plugin is enabled (see [Metrics Configuration](./configuration.md)).
Metrics enabled when `dropreason` plugin is enabled (see [Metrics Configuration](../configuration.md)).

| Metric Name | Description | Extra Labels |
| ----------------------- | ------------------------ | --------------------- |
Expand All @@ -59,7 +62,7 @@ Possible values for `reason`:

### Plugin: `linuxutil` (Linux)

Metrics enabled when `linuxutil` plugin is enabled (see [Metrics Configuration](./configuration.md)).
Metrics enabled when `linuxutil` plugin is enabled (see [Metrics Configuration](../configuration.md)).

| Metric Name | Description | Extra Labels |
| ----------------------- | ------------------------------------------------------------------------------- | ---------------------------------- |
Expand Down Expand Up @@ -92,7 +95,7 @@ Possible values for `statistic_name` (for metric `tcp_connection_stats`):
- `TCPTimeouts`
- `TCPTSReorder`
- `ResetCount`
- and many others (full list [here](./plugins/linuxutil.md#label-values-for-tcp_connection_stats))
- and many others (full list [here](../plugins/linuxutil.md#label-values-for-tcp_connection_stats))

Possible values for `statistic_name` (for metric `ip_connection_stats`):

Expand All @@ -119,7 +122,7 @@ Possible values for `statistic_name` (for metric `interface_stats`):

### Plugin: `dns` (Linux)

Metrics enabled when `dns` plugin is enabled (see [Metrics Configuration](./configuration.md)).
Metrics enabled when `dns` plugin is enabled (see [Metrics Configuration](../configuration.md)).

| Metric Name | Description | Extra Labels |
| ---------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
Expand All @@ -128,7 +131,7 @@ Metrics enabled when `dns` plugin is enabled (see [Metrics Configuration](./conf

### Plugin: `hnsstats` (Windows)

Metrics enabled when `hnsstats` plugin is enabled (see [Metrics Configuration](./configuration.md)).
Metrics enabled when `hnsstats` plugin is enabled (see [Metrics Configuration](../configuration.md)).

| Name | Description | Extra Labels |
| ----------------------- | ----------------------------------------------| --------------------- |
Expand Down
9 changes: 6 additions & 3 deletions docs/metrics/modes.md → docs/03-Metrics/modes/modes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
sidebar_position: 1
---
# Metric Modes

Retina provides **three modes** with their own metrics and scale capabilities.
Expand All @@ -8,9 +11,9 @@ The larger the cardinality, the more load induced on a Prometheus server for ins

| Mode | Description | Scale | Metrics | Configuration |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| *Basic* | Metrics aggregated by Node. | Metric cardinality proportional to number of nodes. | [Link to Metrics](./basic.md) | [Link to Installation](../installation/setup.md#basic-mode) |
| *Advanced/Pod-Level with remote context* | Basic metrics plus extra metrics aggregated by source and destination Pod. | Has scale limitations. Metric cardinality is unbounded (proportional to number of source/destination pairs, including external IPs). | [Link to Metrics](./advanced.md) | [Link to Installation](../installation/setup.md#advanced-mode-with-remote-context-with-support-for-captures) |
| *Advanced/Pod-Level with local context* | Basic metrics plus extra metrics aggregated by "local" Pod (source for outgoing traffic, destination for incoming traffic). Also lets you specify which Pods to observe (create metrics for) with [Annotations](./annotations.md). | Designed for scale. Metric cardinality proportional to number of Pods observed. | [Link to Metrics](./advanced.md) | [Link to Installation](../installation/setup.md#advanced-mode-with-local-context-with-support-for-captures) |
| *Basic* | Metrics aggregated by Node. | Metric cardinality proportional to number of nodes. | [Link to Metrics](./basic.md) | [Link to Installation](../../02-Installation/01-Setup.md#basic-mode) |
| *Advanced/Pod-Level with remote context* | Basic metrics plus extra metrics aggregated by source and destination Pod. | Has scale limitations. Metric cardinality is unbounded (proportional to number of source/destination pairs, including external IPs). | [Link to Metrics](./advanced.md) | [Link to Installation](../../02-Installation/01-Setup.md#advanced-mode-with-local-context-with-capture-support) |
| *Advanced/Pod-Level with local context* | Basic metrics plus extra metrics aggregated by "local" Pod (source for outgoing traffic, destination for incoming traffic). Also lets you specify which Pods to observe (create metrics for) with [Annotations](../annotations.md). | Designed for scale. Metric cardinality proportional to number of Pods observed. | [Link to Metrics](./advanced.md) | [Link to Installation](../../02-Installation/01-Setup.md#advanced-mode-with-local-context-with-capture-support) |

## Where Do Metrics Come From?

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tracks incoming and outgoing DNS traffic, providing various metrics and details

## Metrics

See metrics for [Basic Mode](../basic.md#plugin-dns-linux) or [Advanced Mode](../advanced.md#plugin-dns-linux).
See metrics for [Basic Mode](../modes/basic.md#plugin-dns-linux) or [Advanced Mode](../modes/advanced.md#plugin-dns-linux).

## Architecture

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Counts number of packets/bytes dropped on a Node, along with the direction and r

## Metrics

See metrics for [Basic Mode](../basic.md#plugin-dropreason-linux) or [Advanced Mode](../advanced.md#plugin-dropreason-linux).
See metrics for [Basic Mode](../modes/basic.md#plugin-dropreason-linux) or [Advanced Mode](../modes/advanced.md#plugin-dropreason-linux).

## Architecture

The plugin utilizes eBPF to gather data.
The plugin generates Basic metrics from an eBPF result.
In Advanced mode (see [Metric Modes](../modes.md)), the plugin turns this eBPF result into an enriched `Flow` (adding Pod information based on IP), then sends the `Flow` to an external channel so that a drops module can create extra Pod-Level metrics.
In Advanced mode (see [Metric Modes](../modes/modes.md)), the plugin turns this eBPF result into an enriched `Flow` (adding Pod information based on IP), then sends the `Flow` to an external channel so that a drops module can create extra Pod-Level metrics.

### Code locations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Gathers TCP statistics and counts number of packets/bytes forwarded or dropped i

## Metrics

See metrics for [Basic Mode](../basic.md#plugin-hnsstats-windows) (Advanced modes have identical metrics).
See metrics for [Basic Mode](../modes/basic.md#plugin-hnsstats-windows) (Advanced modes have identical metrics).

## Architecture

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Gathers TCP/UDP statistics and network interface statistics from the `netstats`

## Metrics

See metrics for [Basic Mode](../basic.md#plugin-linuxutil-linux) (Advanced modes have identical metrics).
See metrics for [Basic Mode](../modes/basic.md#plugin-linuxutil-linux) (Advanced modes have identical metrics).

## Architecture

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Counts number of packets/bytes passing through the `eth0` interface of a Node, a

## Metrics

See metrics for [Basic Mode](../basic.md#plugin-packetforward-linux) (Advanced modes have identical metrics).
See metrics for [Basic Mode](../modes/basic.md#plugin-packetforward-linux) (Advanced modes have identical metrics).

Note: `adv_forward_count` and `adv_forward_bytes` metrics are NOT associated with `packetforward` plugin despite similarities in name.
These metrics are associated with [`packetparser` plugin](./packetparser.md).
Expand Down
Loading

0 comments on commit f77b2b4

Please sign in to comment.