Skip to content

Commit

Permalink
doc: add descriptions for helm values.
Browse files Browse the repository at this point in the history
Add descriptions for the values `helmPreUpgradeCheckerJob` and
`serviceMonitor`.

Ref: 7485

Signed-off-by: James Lu <james.lu@suse.com>
  • Loading branch information
mantissahz authored and David Ko committed Jan 3, 2024
1 parent d6f648a commit ae3d499
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
26 changes: 22 additions & 4 deletions content/docs/1.6.0/monitoring/prometheus-and-grafana-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ Follow instructions in [Prometheus Operator - Quickstart](https://github.com/pro
### Install Longhorn ServiceMonitor

1. Create a ServiceMonitor for Longhorn manager.
#### Install Longhorn ServiceMonitor with Kubectl

Create a ServiceMonitor for Longhorn Manager.

```yaml
apiVersion: monitoring.coreos.com/v1
Expand All @@ -61,9 +63,26 @@ Follow instructions in [Prometheus Operator - Quickstart](https://github.com/pro
- port: manager
```

Longhorn ServiceMonitor has a label selector `app: longhorn-manager` for selecting Longhorn backend service.
#### Install Longhorn ServiceMonitor with Helm

1. Modify the YAML file `longhorn/chart/values.yaml`.

```yaml
metrics:
serviceMonitor:
# -- Setting that allows the creation of a Prometheus ServiceMonitor resource for Longhorn Manager components.
enabled: true
```
1. Create a ServiceMonitor for Longhorn Manager using Helm.
```bash
helm upgrade longhorn longhorn/longhorn --namespace longhorn-system -f values.yaml
```

Longhorn ServiceMonitor is included in the Prometheus custom resource so that the Prometheus server can discover all Longhorn manager pods and their endpoints.
Longhorn ServiceMonitor is included in the Prometheus custom resource. This setup allows the Prometheus server to discover all Longhorn Manager pods and their respective endpoints.

You can use the label selector `app: longhorn-manager` to select the longhorn-backend service, which points to the set of Longhorn Manager pods.

### Install and configure Prometheus AlertManager

Expand Down Expand Up @@ -398,4 +417,3 @@ See [Prometheus - Configuration](https://prometheus.io/docs/alerting/latest/conf
You should see the following dashboard at successful setup:
![images](/img/screenshots/monitoring/longhorn-example-grafana-dashboard.png)
4 changes: 2 additions & 2 deletions content/docs/1.6.0/references/helm-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ Please also refer to this document [ocp-readme](https://github.com/longhorn/long
| annotations | `{}` | Annotations to add to the Longhorn Manager DaemonSet Pods. Optional. |
| enableGoCoverDir | `false` | Enable this to allow Longhorn to generate code coverage profiles |
| enablePSP | `false` | For Kubernetes < v1.25, if your cluster enables Pod Security Policy admission controller, set this to `true` to ship longhorn-psp which allow privileged Longhorn pods to start |
| helmPreUpgradeCheckerJob.enabled | `true` | |
| metrics.serviceMonitor.enabled | `false` | |
| helmPreUpgradeCheckerJob.enabled | `true` | Setting that allows Longhorn to perform pre-upgrade checks. Disable this setting when installing Longhorn using Argo CD or other GitOps solutions. |
| metrics.serviceMonitor.enabled | `false` | Setting that allows the creation of a Prometheus ServiceMonitor resource for Longhorn Manager components. |

### System Default Settings

Expand Down

0 comments on commit ae3d499

Please sign in to comment.