Skip to content

Commit

Permalink
chart: collect all prometheus-operator resources by default
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Krupa (paulfantom) <pawel@krupa.net.pl>
  • Loading branch information
paulfantom committed Oct 17, 2022
1 parent 5dab2d2 commit 297efc3
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 4 deletions.
5 changes: 2 additions & 3 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -26,8 +26,7 @@ dependencies:
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.0
repository: https://prometheus-community.github.io/helm-charts
- name: opentelemetry-operator
condition: opentelemetry-operator.enabled
Expand Down
41 changes: 40 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions docs/upgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 297efc3

Please # to comment.