Skip to content

Commit 259c9dd

Browse files
shlomitubulBitnami Containersdgomezleon
authoredJan 26, 2024
[bitnami/redis] - add support for additional-endpoints in service/pod monitor (#22250)
* [bitnami/redis] - add support for additional-endpoints in service/pod monitor Signed-off-by: ShlomiTubul <shlomi.tubul@placer.ai> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> * [bitnami/redis] - bump redis chart version Signed-off-by: ShlomiTubul <shlomi.tubul@placer.ai> * [bitnami/redis] - remove unnecessary selector from pod-monitor.yaml Signed-off-by: ShlomiTubul <shlomi.tubul@placer.ai> * [bitnami/redis] - update comment in values.yaml Signed-off-by: ShlomiTubul <shlomi.tubul@placer.ai> --------- Signed-off-by: ShlomiTubul <shlomi.tubul@placer.ai> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Signed-off-by: shlomi tubul <33376277+shlomitubul@users.noreply.github.com> Signed-off-by: David Gomez <dgomezleon@vmware.com> Co-authored-by: ShlomiTubul <shlomi.tubul@placer.ai> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: David Gomez <dgomezleon@vmware.com>
1 parent 79df86d commit 259c9dd

File tree

5 files changed

+62
-5
lines changed

5 files changed

+62
-5
lines changed
 

‎bitnami/redis/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ maintainers:
3434
name: redis
3535
sources:
3636
- https://github.com/bitnami/charts/tree/main/bitnami/redis
37-
version: 18.8.3
37+
version: 18.9.0

‎bitnami/redis/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ The command removes all the Kubernetes components associated with the chart and
561561
| `metrics.serviceMonitor.podTargetLabels` | Labels from the Kubernetes pod to be transferred to the created metrics | `[]` |
562562
| `metrics.serviceMonitor.sampleLimit` | Limit of how many samples should be scraped from every Pod | `false` |
563563
| `metrics.serviceMonitor.targetLimit` | Limit of how many targets should be scraped | `false` |
564+
| `metrics.serviceMonitor.additionalEndpoints` | Additional endpoints to scrape (e.g sentinel) | `[]` |
564565
| `metrics.podMonitor.enabled` | Create PodMonitor resource(s) for scraping metrics using PrometheusOperator | `false` |
565566
| `metrics.podMonitor.namespace` | The namespace in which the PodMonitor will be created | `""` |
566567
| `metrics.podMonitor.interval` | The interval at which metrics should be scraped | `30s` |
@@ -572,6 +573,7 @@ The command removes all the Kubernetes components associated with the chart and
572573
| `metrics.podMonitor.podTargetLabels` | Labels from the Kubernetes pod to be transferred to the created metrics | `[]` |
573574
| `metrics.podMonitor.sampleLimit` | Limit of how many samples should be scraped from every Pod | `false` |
574575
| `metrics.podMonitor.targetLimit` | Limit of how many targets should be scraped | `false` |
576+
| `metrics.podMonitor.additionalEndpoints` | Additional endpoints to scrape (e.g sentinel) | `[]` |
575577
| `metrics.prometheusRule.enabled` | Create a custom prometheusRule Resource for scraping metrics using PrometheusOperator | `false` |
576578
| `metrics.prometheusRule.namespace` | The namespace in which the prometheusRule will be created | `""` |
577579
| `metrics.prometheusRule.additionalLabels` | Additional labels for the prometheusRule | `{}` |

‎bitnami/redis/templates/podmonitor.yaml

+18-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,24 @@ spec:
3434
{{- if .Values.metrics.podMonitor.metricRelabelings }}
3535
metricRelabelings: {{- toYaml .Values.metrics.podMonitor.metricRelabelings | nindent 6 }}
3636
{{- end }}
37+
{{- range .Values.metrics.podMonitor.additionalEndpoints }}
38+
- port: {{ .port }}
39+
{{- if .interval }}
40+
interval: {{ .interval }}
41+
{{- end }}
42+
{{- if .path }}
43+
path: {{ .path }}
44+
{{- end }}
45+
{{- if .params }}
46+
params:
47+
{{- range $key, $value := .params }}
48+
{{ $key }}:
49+
{{- range $value }}
50+
- {{ . | quote }}
51+
{{- end }}
52+
{{- end }}
53+
{{- end }}
54+
{{- end }}
3755
{{- if .Values.metrics.serviceMonitor.podTargetLabels }}
3856
podTargetLabels: {{- toYaml .Values.metrics.podMonitor.podTargetLabels | nindent 4 }}
3957
{{- end }}
@@ -48,5 +66,4 @@ spec:
4866
- {{ include "common.names.namespace" . | quote }}
4967
selector:
5068
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
51-
app.kubernetes.io/component: metrics
5269
{{- end }}

‎bitnami/redis/templates/servicemonitor.yaml

+20-2
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,31 @@ spec:
3434
{{- if .Values.metrics.serviceMonitor.metricRelabelings }}
3535
metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 6 }}
3636
{{- end }}
37+
{{- range .Values.metrics.serviceMonitor.additionalEndpoints }}
38+
- port: {{ .port }}
39+
{{- if .interval }}
40+
interval: {{ .interval }}
41+
{{- end }}
42+
{{- if .path }}
43+
path: {{ .path }}
44+
{{- end }}
45+
{{- if .params }}
46+
params:
47+
{{- range $key, $value := .params }}
48+
{{ $key }}:
49+
{{- range $value }}
50+
- {{ . | quote }}
51+
{{- end }}
52+
{{- end }}
53+
{{- end }}
54+
{{- end }}
3755
{{- if .Values.metrics.serviceMonitor.podTargetLabels }}
3856
podTargetLabels: {{- toYaml .Values.metrics.serviceMonitor.podTargetLabels | nindent 4 }}
3957
{{- end }}
40-
{{ with .Values.metrics.serviceMonitor.sampleLimit }}
58+
{{- with .Values.metrics.serviceMonitor.sampleLimit }}
4159
sampleLimit: {{ . }}
4260
{{- end }}
43-
{{ with .Values.metrics.serviceMonitor.targetLimit }}
61+
{{- with .Values.metrics.serviceMonitor.targetLimit }}
4462
targetLimit: {{ . }}
4563
{{- end }}
4664
namespaceSelector:

‎bitnami/redis/values.yaml

+21-1
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ networkPolicy:
14691469
##
14701470
ingressNSMatchLabels: {}
14711471
ingressNSPodMatchLabels: {}
1472-
1472+
14731473
## PodSecurityPolicy configuration
14741474
## ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
14751475
##
@@ -1784,6 +1784,16 @@ metrics:
17841784
## @param metrics.serviceMonitor.targetLimit Limit of how many targets should be scraped
17851785
##
17861786
targetLimit: false
1787+
## @param metrics.serviceMonitor.additionalEndpoints Additional endpoints to scrape (e.g sentinel)
1788+
##
1789+
additionalEndpoints: []
1790+
# uncomment in order to scrape sentinel metrics
1791+
# - port: http-metrics
1792+
# interval: 30s
1793+
# path: /scrape
1794+
# params:
1795+
# target:
1796+
# - localhost:26379
17871797
## Prometheus Pod Monitor
17881798
## ref: https://github.com/coreos/prometheus-operator
17891799
## https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#podmonitor
@@ -1822,6 +1832,16 @@ metrics:
18221832
## @param metrics.podMonitor.targetLimit Limit of how many targets should be scraped
18231833
##
18241834
targetLimit: false
1835+
## @param metrics.podMonitor.additionalEndpoints Additional endpoints to scrape (e.g sentinel)
1836+
##
1837+
additionalEndpoints: []
1838+
# uncomment in order to scrape sentinel metrics
1839+
# - port: metrics
1840+
# interval: 30s
1841+
# path: /scrape
1842+
# params:
1843+
# target:
1844+
# - localhost:26379
18251845

18261846
## Custom PrometheusRule to be defined
18271847
## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions

0 commit comments

Comments
 (0)
Please sign in to comment.