From 73b01fec287767f5ee62e4aa19777d8c33db98b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa=20=28paulfantom=29?= Date: Tue, 18 Oct 2022 20:22:39 +0200 Subject: [PATCH 1/3] chart: collect all prometheus-operator resources by default --- chart/Chart.yaml | 2 +- chart/values.yaml | 41 ++++++++++++++++++++++++++++++++++++++++- docs/upgrades.md | 22 ++++++++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 5927a552..1faab911 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -12,7 +12,7 @@ keywords: - monitoring - tracing - opentelemetry -version: 16.3.0 +version: 17.0.0 # TODO(paulfantom): Enable after kubernetes 1.22 reaches EOL (2022-10-28) # kubeVersion: ">= 1.23.0" dependencies: diff --git a/chart/values.yaml b/chart/values.yaml index 7d239dc9..b2d4538d 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -157,6 +157,45 @@ kube-prometheus-stack: replicaExternalLabelName: "__replica__" # Promscale requires a cluster label to be present for high availability mode. prometheusExternalLabelName: "cluster" + + # By default collect all PrometheusRules and scrape configuration from the cluster + # Exclude all resources labeled with `tobs/excluded` + ruleSelectorNilUsesHelmValues: false + ruleNamespaceSelector: + matchExpressions: + - key: tobs/excluded + operator: DoesNotExist + ruleSelector: + matchExpressions: + - key: tobs/excluded + operator: DoesNotExist + serviceMonitorSelectorNilUsesHelmValues: false + serviceMonitorSelector: + matchExpressions: + - key: tobs/excluded + operator: DoesNotExist + serviceMonitorNamespaceSelector: + matchExpressions: + - key: tobs/excluded + operator: DoesNotExist + podMonitorSelectorNilUsesHelmValues: false + podMonitorSelector: + matchExpressions: + - key: tobs/excluded + operator: DoesNotExist + podMonitorNamespaceSelector: + matchExpressions: + - key: tobs/excluded + operator: DoesNotExist + probeSelectorNilUsesHelmValues: false + probeSelector: + matchExpressions: + - key: tobs/excluded + operator: DoesNotExist + probeNamespaceSelector: + matchExpressions: + - key: tobs/excluded + operator: DoesNotExist # The remote_read spec configuration for Prometheus. # ref: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#remotereadspec remoteRead: @@ -198,7 +237,7 @@ kube-prometheus-stack: # Expected values are the secret name and key # Cannot be used with additionalScrapeConfigs additionalScrapeConfigsSecret: - enabled: true + enabled: false name: tobs-scrape-config key: additional-scrape-config.yaml # Values for configuring the deployment of Grafana diff --git a/docs/upgrades.md b/docs/upgrades.md index cfcd45a9..8886baa9 100644 --- a/docs/upgrades.md +++ b/docs/upgrades.md @@ -8,6 +8,28 @@ Firstly upgrade the helm repo to pull the latest available tobs helm chart. We a helm repo update ``` +## Upgrading from 16.x to 17.x + +With `17.0.0` we decided to diverge from gathering metrics data only from +namespace in which tobs is deployed and extend it to all namespaces. To +accomplish this we changed default kube-prometheus-stack selectors to gather +all prometheus-operator resources that are not labeled with `tobs/excluded` +(label value doesn't matter). If you have any other prometheus-operator +resources in your cluster that you don't want to be scraped by tobs, you need +to label them with `tobs/excluded` label. + +Additionally, to prevent data duplication, we are disabling by default +ability to scrape endpoints using prometheus label annotations. If you wish +to continue using this option, you need to explicitly set the following +option: +```yaml +kube-prometheus-stack: + prometheus: + prometheusSpec: + additionalScrapeConfigsSecret: + enabled: true +``` + ## Upgrading from 15.x to 16.x With `16.0.0` we removed `grafana-db-sec.yaml` generated Secret as it's no From aa20cb85846855616bf99c5465032aec1947d852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa=20=28paulfantom=29?= Date: Tue, 18 Oct 2022 20:22:52 +0200 Subject: [PATCH 2/3] chart: bump dependencies and remove timescaledb loadbalancer settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Krupa (paulfantom) --- Makefile | 1 - chart/Chart.yaml | 9 ++++----- chart/README.md | 1 - chart/values.yaml | 3 --- docs/upgrades.md | 8 +++++--- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 29031342..c32d0959 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,6 @@ timescaledb: ## This is a phony target that is used to install the timescaledb-s timescaledb/timescaledb-single \ --namespace=timescaledb \ --set replicaCount=1 \ - --set loadBalancer.enabled=false \ --set secrets.credentials.PATRONI_SUPERUSER_PASSWORD="temporarypassword" \ --set secrets.credentials.PATRONI_admin_PASSWORD="temporarypassword" \ --set patroni.log.level=INFO diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 1faab911..a25fba06 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -18,18 +18,17 @@ version: 17.0.0 dependencies: - name: timescaledb-single condition: timescaledb-single.enabled - version: 0.19.0 + version: 0.20.0 repository: https://charts.timescale.com - name: promscale condition: promscale.enabled - version: 14.2.0 + version: 14.3.0 repository: https://charts.timescale.com - name: kube-prometheus-stack condition: kube-prometheus-stack.enabled - # With each major bump make sure prometheus-operator CRD version matches version specified in cli/pkg/upgrade/upgrade.go#KubePrometheusCRDVersion - version: 40.5.0 + version: 41.4.1 repository: https://prometheus-community.github.io/helm-charts - name: opentelemetry-operator condition: opentelemetry-operator.enabled - version: 0.13.3 + version: 0.14.0 repository: https://open-telemetry.github.io/opentelemetry-helm-charts diff --git a/chart/README.md b/chart/README.md index ec83d296..88b1b67c 100644 --- a/chart/README.md +++ b/chart/README.md @@ -186,7 +186,6 @@ The chart has the following properties in the `values.yaml` file: | ------------------------------------------------ | ------------------------------------------------- | ------------------- | | `timescaledb-single.enabled` | If false TimescaleDB will not be created | `true` | | `timescaledb-single.image.tag` | Docker image tag to use for TimescaleDB | `pg14.4-ts2.7.2-p0` | -| `timescaledb-single.loadBalancer.enabled` | Create a LB for the DB instead of a ClusterIP | `false` | | `timescaledb-single.replicaCount` | Number of pods for DB, set to 3 for HA | `1` | | `timescaledb-single.backup.enabled` | TimescaleDB backup option by default set to false | `false` | | `timescaledb-single.persistentVolumes.data.size` | Size of the volume for the database | `150Gi` | diff --git a/chart/values.yaml b/chart/values.yaml index b2d4538d..13262a79 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -18,9 +18,6 @@ timescaledb-single: env: - name: TSTUNE_PROFILE value: promscale - # create only a ClusterIP service - loadBalancer: - enabled: false # number or TimescaleDB pods to spawn (default is 3, 1 for no HA) replicaCount: 1 # backup is disabled by default, enable it diff --git a/docs/upgrades.md b/docs/upgrades.md index 8886baa9..8cc53d88 100644 --- a/docs/upgrades.md +++ b/docs/upgrades.md @@ -10,9 +10,9 @@ helm repo update ## Upgrading from 16.x to 17.x -With `17.0.0` we decided to diverge from gathering metrics data only from -namespace in which tobs is deployed and extend it to all namespaces. To -accomplish this we changed default kube-prometheus-stack selectors to gather +With `17.0.0` we decided to diverge from gathering metrics data only from +namespace in which tobs is deployed and extend it to all namespaces. To +accomplish this we changed default kube-prometheus-stack selectors to gather all prometheus-operator resources that are not labeled with `tobs/excluded` (label value doesn't matter). If you have any other prometheus-operator resources in your cluster that you don't want to be scraped by tobs, you need @@ -30,6 +30,8 @@ kube-prometheus-stack: enabled: true ``` +In `17.0.0` we are also updating timescaledb-single chart to version `0.20.0`, which by default uses `ClusterIP` instead of `LoadBalancer` service. This change removes opttion removes field of `timescaledb-single.service.loadBalancerIP`. + ## Upgrading from 15.x to 16.x With `16.0.0` we removed `grafana-db-sec.yaml` generated Secret as it's no From d7e08d07ff90c36fe7d612d35577e709b56751f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa=20=28paulfantom=29?= Date: Wed, 19 Oct 2022 16:28:10 +0200 Subject: [PATCH 3/3] chart/scripts: adjust metrics test to account for issues with upstream chart --- chart/scripts/test-metrics.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/scripts/test-metrics.sh b/chart/scripts/test-metrics.sh index 5e9be1ba..3410ad2c 100755 --- a/chart/scripts/test-metrics.sh +++ b/chart/scripts/test-metrics.sh @@ -40,7 +40,7 @@ EOF ) genericTests=$(cat <<-EOF { - "expression": "up{namespace=\"$NAMESPACE\"}==0", + "expression": "up{namespace=\"$NAMESPACE\",pod!~".*-grafana-test"}==0", "expected": false } EOF