Skip to content

Commit

Permalink
Improve monitoring docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rxbn committed Mar 18, 2023
1 parent 42f53b3 commit 625c93a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
25 changes: 17 additions & 8 deletions content/en/docs/cloudflare-operator/guides/monitoring.md
Expand Up @@ -13,17 +13,26 @@ description: "Monitor cloudflare-operator with Prometheus"
The easiest way to deploy all the necessary components is to use
[kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack).

## Install cloudflare-operator Grafana dashboard
## Enable metrics

Note that cloudflare-operator exposes the `/metrics` endpoint on port `8080`.
When using Prometheus Operator, you need a `PodMonitor` object to configure scraping for the controller pod.
In order to enable metrics and automatically deploy the required resources, you need to reconfigure the Helm chart.

Apply the `PodMonitor` and create a ConfigMap with the cloudflare-operator dashboard:
Create a `values.yaml` file with the following content:

```bash
# Create a podmonitor
kubectl apply -f https://raw.githubusercontent.com/containeroo/cloudflare-operator/master/config/manifests/prometheus/monitor.yaml
```yaml
---
metrics:
podMonitor:
enabled: true
prometheusRule:
enabled: true
```

Now you can install / upgrade the Helm chart by following [the installation guide](/docs/cloudflare-operator/installation/#customized-installation).

## Install cloudflare-operator Grafana dashboard

```bash
# Download Grafana dashboard
wget https://raw.githubusercontent.com/containeroo/cloudflare-operator/master/config/manifests/grafana/dashboards/overview.json -O /tmp/grafana-dashboard-cloudflare-operator.json

Expand All @@ -34,7 +43,7 @@ kubectl create configmap grafana-dashboard-cloudflare-operator --from-file=/tmp/
kubectl label configmap grafana-dashboard-cloudflare-operator grafana_dashboard="1"
```

## Metrics
## Available metrics

For each `cf.containeroo.ch` kind, the controller exposes a gauge metric to track the status condition.

Expand Down
6 changes: 3 additions & 3 deletions content/en/docs/cloudflare-operator/installation.md
Expand Up @@ -51,7 +51,7 @@ kubectl apply -f https://github.com/containeroo/cloudflare-operator/releases/dow
To install the latest version of cloudflare-operator, run the following command:

```bash
helm install \
helm upgrade --install \
cloudflare-operator containeroo/cloudflare-operator \
--namespace cloudflare-operator \
--create-namespace
Expand All @@ -61,7 +61,7 @@ If you want to install a specific version of cloudflare-operator, run the follow

```bash
export VERSION=x.y.z
helm install \
helm upgrade --install \
cloudflare-operator containeroo/cloudflare-operator \
--namespace cloudflare-operator \
--create-namespace \
Expand All @@ -86,7 +86,7 @@ image:
Run the following command to install cloudflare-operator with the customized Helm values:

```bash
helm install \
helm upgrade --install \
cloudflare-operator containeroo/cloudflare-operator \
--namespace cloudflare-operator \
--create-namespace \
Expand Down

0 comments on commit 625c93a

Please sign in to comment.