From 4778ea11338cb8e7d8a6af6691e4014e9a4e2cc2 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sun, 1 Sep 2024 08:30:41 -0700 Subject: [PATCH] Update monitoring docs Signed-off-by: Tamal Saha --- docs/setup/monitoring/builtin-prometheus.md | 11 +++-------- docs/setup/monitoring/prometheus-operator.md | 13 ++++--------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/docs/setup/monitoring/builtin-prometheus.md b/docs/setup/monitoring/builtin-prometheus.md index 5e6233c09..2959e7125 100644 --- a/docs/setup/monitoring/builtin-prometheus.md +++ b/docs/setup/monitoring/builtin-prometheus.md @@ -41,10 +41,7 @@ Let's install KubeDB with operator monitoring enabled. $ helm install kubedb oci://ghcr.io/appscode-charts/kubedb \ --version {{< param "info.version" >}} \ --namespace kubedb --create-namespace \ - --set kubedb-provisioner.monitoring.enabled=true \ - --set kubedb-provisioner.monitoring.agent=prometheus.io/builtin \ - --set kubedb-provisioner.monitoring.prometheus.namespace=monitoring \ - --set kubedb-provisioner.monitoring.serviceMonitor.labels.release=prometheus + --set global.monitoring.agent=prometheus.io/builtin ``` **YAML (with Helm 3):** @@ -53,10 +50,8 @@ $ helm install kubedb oci://ghcr.io/appscode-charts/kubedb \ $ helm template kubedb oci://ghcr.io/appscode-charts/kubedb \ --version {{< param "info.version" >}} \ --namespace kubedb --create-namespace \ - --set kubedb-provisioner.monitoring.enabled=true \ - --set kubedb-provisioner.monitoring.agent=prometheus.io/builtin \ - --set kubedb-provisioner.monitoring.prometheus.namespace=monitoring \ - --set kubedb-provisioner.monitoring.serviceMonitor.labels.release=prometheus | kubectl apply -f - + --no-hooks \ + --set global.monitoring.agent=prometheus.io/builtin | kubectl apply -f - ``` This will add necessary annotations to `kubedb` service created in `kubedb` namespace. Prometheus server will scrape metrics using those annotations. Let's check which annotations are added to the service, diff --git a/docs/setup/monitoring/prometheus-operator.md b/docs/setup/monitoring/prometheus-operator.md index cc2046d35..0baf0765b 100644 --- a/docs/setup/monitoring/prometheus-operator.md +++ b/docs/setup/monitoring/prometheus-operator.md @@ -41,11 +41,8 @@ Let's install KubeDB operator with monitoring enabled. $ helm install kubedb oci://ghcr.io/appscode-charts/kubedb \ --version {{< param "info.version" >}} \ --namespace kubedb --create-namespace \ - --no-hooks \ - --set monitoring.enabled=true \ - --set monitoring.agent=prometheus.io/operator \ - --set monitoring.prometheus.namespace=monitoring \ - --set monitoring.serviceMonitor.labels.release=prometheus + --set global.monitoring.agent=prometheus.io/operator \ + --set global.monitoring.serviceMonitor.labels.release=kube-prometheus-stack ``` **YAML (with Helm 3):** @@ -55,10 +52,8 @@ $ helm template kubedb oci://ghcr.io/appscode-charts/kubedb \ --version {{< param "info.version" >}} \ --namespace kubedb --create-namespace \ --no-hooks \ - --set monitoring.enabled=true \ - --set monitoring.agent=prometheus.io/operator \ - --set monitoring.prometheus.namespace=monitoring \ - --set monitoring.serviceMonitor.labels.release=prometheus | kubectl apply -f - + --set global.monitoring.agent=prometheus.io/operator \ + --set global.monitoring.serviceMonitor.labels.release=kube-prometheus-stack | kubectl apply -f - ``` This will create a `ServiceMonitor` crd with name `kubedb-servicemonitor` in `monitoring` namespace for monitoring endpoints of `kubedb` service. This `ServiceMonitor` will have label `release: prometheus` as we have provided it by `--servicemonitor-label` flag. This label will be used by Prometheus crd to select this `ServiceMonitor`.