From 625c93a20b4f6e2c07c02e5c46d4aa4cece41342 Mon Sep 17 00:00:00 2001 From: Robin Scherrer Date: Sat, 18 Mar 2023 22:02:04 +0100 Subject: [PATCH] Improve monitoring docs --- .../cloudflare-operator/guides/monitoring.md | 25 +++++++++++++------ .../docs/cloudflare-operator/installation.md | 6 ++--- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/content/en/docs/cloudflare-operator/guides/monitoring.md b/content/en/docs/cloudflare-operator/guides/monitoring.md index c07ba61..8dadb18 100644 --- a/content/en/docs/cloudflare-operator/guides/monitoring.md +++ b/content/en/docs/cloudflare-operator/guides/monitoring.md @@ -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 @@ -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. diff --git a/content/en/docs/cloudflare-operator/installation.md b/content/en/docs/cloudflare-operator/installation.md index 3a26db3..8b78ecd 100644 --- a/content/en/docs/cloudflare-operator/installation.md +++ b/content/en/docs/cloudflare-operator/installation.md @@ -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 @@ -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 \ @@ -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 \