Skip to content

Commit

Permalink
Document possibility to use external Prometheus server
Browse files Browse the repository at this point in the history
  • Loading branch information
frisso authored and adamjensenbot committed May 26, 2023
1 parent f12cb8b commit e0e334e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
6 changes: 3 additions & 3 deletions deployments/liqo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
| gateway.imageName | string | `"ghcr.io/liqotech/liqonet"` | Image repository for the network gateway pod. |
| gateway.metrics.enabled | bool | `false` | Expose metrics about network traffic towards cluster peers. |
| gateway.metrics.port | int | `5872` | Port used to expose metrics. |
| gateway.metrics.serviceMonitor.enabled | bool | `false` | Enable/Disable a Prometheus servicemonitor. |
| gateway.metrics.serviceMonitor.enabled | bool | `false` | Enable/Disable a Prometheus servicemonitor. Turn on this flag when the Prometheus Operator runs in your cluster; otherwise simply export the port above as an external endpoint. |
| gateway.metrics.serviceMonitor.interval | string | `""` | Customize service monitor requests interval. If empty, Prometheus uses the global scrape interval (https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#endpoint). |
| gateway.metrics.serviceMonitor.scrapeTimeout | string | `""` | Customize service monitor scrape timeout. If empty, Prometheus uses the global scrape timeout (https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#endpoint). |
| gateway.pod.annotations | object | `{}` | Annotations for the network gateway pod. |
Expand All @@ -74,7 +74,7 @@
| gateway.replicas | int | `1` | The number of gateway instances to run. The gateway component supports active/passive high availability. Make sure that there are enough nodes to accommodate the replicas, because such pod has to run in the host network, hence no more than one replica can be scheduled on a given node. |
| gateway.service.annotations | object | `{}` | |
| gateway.service.type | string | `"LoadBalancer"` | Kubernetes service to be used to expose the network gateway pod. If you plan to use liqo over the Internet, consider to change this field to "LoadBalancer". Instead, if your nodes are directly reachable from the cluster you are peering to, you may change it to "NodePort". |
| metricAgent.enable | bool | `true` | Enable/Disable the metric agent. |
| metricAgent.enable | bool | `true` | Enable/Disable the virtual kubelet metric agent. This component aggregates all the kubelet-related metrics (e.g., CPU, RAM, etc) collected on the nodes that are used by a remote cluster peered with you, then exporting the resulting values as a property of the virtual kubelet running on the remote cluster. |
| metricAgent.imageName | string | `"ghcr.io/liqotech/metric-agent"` | Image repository for the metricAgent pod. |
| metricAgent.initContainer.imageName | string | `"ghcr.io/liqotech/cert-creator"` | Image repository for the authentication init container for the metricAgent pod. |
| metricAgent.pod.annotations | object | `{}` | Annotations for the metricAgent pod. |
Expand Down Expand Up @@ -135,7 +135,7 @@
| virtualKubelet.extra.resources | object | `{"limits":{},"requests":{}}` | Resource requests and limits (https://kubernetes.io/docs/user-guide/compute-resources/) for the virtual kubelet pod. |
| virtualKubelet.imageName | string | `"ghcr.io/liqotech/virtual-kubelet"` | Image repository for the virtual kubelet. |
| virtualKubelet.metrics.enabled | bool | `false` | Enable/Disable to expose metrics about virtual kubelet resources. |
| virtualKubelet.metrics.podMonitor.enabled | bool | `false` | Enable/Disable the creation of a Prometheus podmonitor. |
| virtualKubelet.metrics.podMonitor.enabled | bool | `false` | Enable/Disable the creation of a Prometheus podmonitor. Turn on this flag when the Prometheus Operator runs in your cluster; otherwise simply export the port above as an external endpoint. |
| virtualKubelet.metrics.podMonitor.interval | string | `""` | Setup pod monitor requests interval. If empty, Prometheus uses the global scrape interval (https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#endpoint). |
| virtualKubelet.metrics.podMonitor.scrapeTimeout | string | `""` | Setup pod monitor scrape timeout. If empty, Prometheus uses the global scrape timeout (https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#endpoint). |
| virtualKubelet.metrics.port | int | `5872` | Port used to expose metrics. |
Expand Down
10 changes: 7 additions & 3 deletions deployments/liqo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ gateway:
# -- Port used to expose metrics.
port: 5872
serviceMonitor:
# -- Enable/Disable a Prometheus servicemonitor.
# -- Enable/Disable a Prometheus servicemonitor. Turn on this flag when the Prometheus Operator
# runs in your cluster; otherwise simply export the port above as an external endpoint.
enabled: false
# -- Customize service monitor requests interval. If empty, Prometheus uses the global scrape interval
# (https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#endpoint).
Expand Down Expand Up @@ -256,7 +257,9 @@ auth:
portOverride: ""

metricAgent:
# -- Enable/Disable the metric agent.
# -- Enable/Disable the virtual kubelet metric agent. This component aggregates all the kubelet-related metrics
# (e.g., CPU, RAM, etc) collected on the nodes that are used by a remote cluster peered with you, then exporting
# the resulting values as a property of the virtual kubelet running on the remote cluster.
enable: true
pod:
# -- Annotations for the metricAgent pod.
Expand Down Expand Up @@ -332,7 +335,8 @@ virtualKubelet:
# -- Port used to expose metrics.
port: 5872
podMonitor:
# -- Enable/Disable the creation of a Prometheus podmonitor.
# -- Enable/Disable the creation of a Prometheus podmonitor. Turn on this flag when the Prometheus Operator
# runs in your cluster; otherwise simply export the port above as an external endpoint.
enabled: false
# -- Setup pod monitor requests interval. If empty, Prometheus uses the global scrape interval
# (https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#endpoint).
Expand Down
12 changes: 7 additions & 5 deletions docs/usage/prometheus-metrics.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Prometheus Metrics

This section presents the metrics exposed by Liqo, using the [Prometheus](https://prometheus.io/) format.
Although in this page we suppose Prometeus is running in your cluster, please note that this is not strictly required: metrics can be scraped also by an external Prometheus server, with Liqo metrics exposed through a dedicated endpoint.

## Scraping metrics

Metrics are scraped depending on how your **Prometheus server(s)** has been configured.
Liqo assumes that you leverage the [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator) to run Prometheus, hence providing a **ServiceMonitor** resource for each component and a **PodMonitor** resource for the Virtual kubelet.

Gathering of Liqo metrics is **disabled** by default.
To allow Prometheus to scrape metrics from Liqo, you should set the `--enable-metrics` *liqoctl* flag during installation (cf. [installation customization options](InstallCustomization)), which configures Liqo to expose metrics, and it creates the proper **ServiceMonitor** and **PodMonitor** resources.
To enable the scraping of Liqo metrics, you should set the `--enable-metrics` *liqoctl* flag during installation (cf. [installation customization options](InstallCustomization)).
In this case, Liqo assumes that you leverage the [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator) to run Prometheus, hence it creates also the proper **ServiceMonitor** and **PodMonitor** resources that are automatically associated to the components that export metrics (e.g., network gateway, virtual kubelet).
Finally, metrics are scraped depending on how your **Prometheus server(s)** has been configured.

Alternatively, you can customize these settings using **Helm** (refer to the [Install with Helm](InstallationHelm) section for further details).
If you need to finely tune the above settings, you should use **Helm**.
For example, this can be useful if your Prometheus server is external to your cluster, hence you want simply to export the Liqo metrics to a public endpoint and scrape them from there.
Refer to the [Install with Helm](InstallationHelm) section for further details.

## Cross-cluster network metrics

Expand Down

0 comments on commit e0e334e

Please sign in to comment.