Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/redis] Fix ServiceMonitor to not leak. (#9722)
Browse files Browse the repository at this point in the history
Previous definition allowed Prometheus to scrape all redis in all namespaces.

Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr>
  • Loading branch information
desaintmartin authored and k8s-ci-robot committed Dec 5, 2018
1 parent 0ab8b4e commit 301ac01
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stable/redis/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: redis
version: 5.0.0
version: 5.1.0
appVersion: 4.0.11
description: Open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
keywords:
Expand Down
2 changes: 1 addition & 1 deletion stable/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ The following table lists the configurable parameters of the Redis chart and the
| `metrics.service.loadBalancerIP` | loadBalancerIP if redis metrics service type is `LoadBalancer` | `nil` |
| `metrics.resources` | Exporter resource requests/limit | Memory: `256Mi`, CPU: `100m` |
| `metrics.serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`) | `false` |
| `metrics.serviceMonitor.namespace` | Namespace which Prometheus is running in | `monitoring` |
| `metrics.serviceMonitor.namespace` | Optional namespace which Prometheus is running in | `nil` |
| `metrics.serviceMonitor.interval` | How frequently to scrape metrics (use by default, falling back to Prometheus' default) | `nil` |
| `metrics.serviceMonitor.selector` | Default to kube-prometheus install (CoreOS recommended), but should be set according to Prometheus install | `{ prometheus: kube-prometheus }` |
| `persistence.existingClaim` | Provide an existing PersistentVolumeClaim | `nil` |
Expand Down
4 changes: 3 additions & 1 deletion stable/redis/templates/metrics-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ spec:
selector:
matchLabels:
app: {{ template "redis.name" . }}
release: {{ .Release.Name }}
namespaceSelector:
any: true
matchNames:
- {{ .Release.Namespace }}
{{- end -}}
3 changes: 2 additions & 1 deletion stable/redis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ metrics:
# Enable this if you're using https://github.com/coreos/prometheus-operator
serviceMonitor:
enabled: false
namespace: monitoring
## Specify a namespace if needed
# namespace: monitoring
# fallback to the prometheus default unless specified
# interval: 10s
## Defaults to what's used if you follow CoreOS [Prometheus Install Instructions](https://github.com/helm/charts/tree/master/stable/prometheus-operator#tldr)
Expand Down

0 comments on commit 301ac01

Please sign in to comment.