mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[stable/redis] Add PrometheusRule. (#20388)
Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: redis
|
||||
version: 10.3.5
|
||||
version: 10.4.0
|
||||
appVersion: 5.0.7
|
||||
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:
|
||||
|
||||
@@ -78,8 +78,8 @@ The following table lists the configurable parameters of the Redis chart and the
|
||||
| `clusterDomain` | Kubernetes DNS Domain name to use | `cluster.local` |
|
||||
| `networkPolicy.enabled` | Enable NetworkPolicy | `false` |
|
||||
| `networkPolicy.allowExternal` | Don't require client label for connections | `true` |
|
||||
| `networkPolicy.ingressNSMatchLabels` | Allow connections from other namespaces | `{}` |
|
||||
| `networkPolicy.ingressNSPodMatchLabels` | For other namespaces match by pod labels and namespace labels | `{}` |
|
||||
| `networkPolicy.ingressNSMatchLabels` | Allow connections from other namespaces | `{}` |
|
||||
| `networkPolicy.ingressNSPodMatchLabels` | For other namespaces match by pod labels and namespace labels | `{}` |
|
||||
| `securityContext.enabled` | Enable security context (both redis master and slave pods) | `true` |
|
||||
| `securityContext.fsGroup` | Group ID for the container (both redis master and slave pods) | `1001` |
|
||||
| `securityContext.runAsUser` | User ID for the container (both redis master and slave pods) | `1001` |
|
||||
@@ -107,6 +107,10 @@ The following table lists the configurable parameters of the Redis chart and the
|
||||
| `metrics.service.labels` | Additional labels for the metrics service | {} |
|
||||
| `metrics.service.loadBalancerIP` | loadBalancerIP if redis metrics service type is `LoadBalancer` | `nil` |
|
||||
| `metrics.priorityClassName` | Metrics exporter pod priorityClassName | {} |
|
||||
| `metrics.prometheusRule.enabled` | Set this to true to create prometheusRules for Prometheus operator | `false` |
|
||||
| `metrics.prometheusRule.additionalLabels` | Additional labels that can be used so prometheusRules will be discovered by Prometheus | `{}` |
|
||||
| `metrics.prometheusRule.namespace` | namespace where prometheusRules resource should be created | Same namespace as redis |
|
||||
| `metrics.prometheusRule.rules` | [rules](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) to be created, check values for an example. | `[]` |
|
||||
| `persistence.existingClaim` | Provide an existing PersistentVolumeClaim | `nil` |
|
||||
| `master.persistence.enabled` | Use a PVC to persist data (master node) | `true` |
|
||||
| `master.persistence.path` | Path to mount the volume at, to use other images | `/data` |
|
||||
@@ -390,7 +394,7 @@ With NetworkPolicy enabled, only pods with the generated client label will be
|
||||
able to connect to Redis. This label will be displayed in the output
|
||||
after a successful install.
|
||||
|
||||
With `networkPolicy.ingressNSMatchLabels` pods from other namespaces can connect to redis. Set `networkPolicy.ingressNSPodMatchLabels` to match pod labels in matched namespace. For example, for a namespace labeled `redis=external` and pods in that namespace labeled `redis-client=true` the fields should be set:
|
||||
With `networkPolicy.ingressNSMatchLabels` pods from other namespaces can connect to redis. Set `networkPolicy.ingressNSPodMatchLabels` to match pod labels in matched namespace. For example, for a namespace labeled `redis=external` and pods in that namespace labeled `redis-client=true` the fields should be set:
|
||||
|
||||
```
|
||||
networkPolicy:
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
name: {{ template "redis.fullname" . }}
|
||||
{{- with .Values.metrics.prometheusRule.namespace }}
|
||||
namespace: {{ . }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "redis.name" . }}
|
||||
chart: {{ template "redis.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
{{- with .Values.metrics.prometheusRule.additionalLabels }}
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.metrics.prometheusRule.rules }}
|
||||
groups:
|
||||
- name: {{ template "redis.name" $ }}
|
||||
rules: {{ tpl (toYaml .) $ | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -520,6 +520,45 @@ metrics:
|
||||
annotations: {}
|
||||
labels: {}
|
||||
|
||||
## Custom PrometheusRule to be defined
|
||||
## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart
|
||||
## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions
|
||||
prometheusRule:
|
||||
enabled: false
|
||||
additionalLabels: {}
|
||||
namespace: ""
|
||||
rules: []
|
||||
## These are just examples rules, please adapt them to your needs.
|
||||
## Make sure to constraint the rules to the current postgresql service.
|
||||
# - alert: RedisDown
|
||||
# expr: redis_up{service="{{ template "redis.fullname" . }}-metrics"} == 0
|
||||
# for: 2m
|
||||
# labels:
|
||||
# severity: error
|
||||
# annotations:
|
||||
# summary: Redis instance {{ "{{ $instance }}" }} down
|
||||
# description: Redis instance {{ "{{ $instance }}" }} is down.
|
||||
# - alert: RedisMemoryHigh
|
||||
# expr: >
|
||||
# redis_memory_used_bytes{service="{{ template "redis.fullname" . }}-metrics"} * 100
|
||||
# /
|
||||
# redis_memory_max_bytes{service="{{ template "redis.fullname" . }}-metrics"}
|
||||
# > 90 =< 100
|
||||
# for: 2m
|
||||
# labels:
|
||||
# severity: error
|
||||
# annotations:
|
||||
# summary: Redis instance {{ "{{ $instance }}" }} is using too much memory
|
||||
# description: Redis instance {{ "{{ $instance }}" }} is using {{ "{{ $value }}" }}% of its available memory.
|
||||
# - alert: RedisKeyEviction
|
||||
# expr: increase(redis_evicted_keys_total{service="{{ template "redis.fullname" . }}-metrics"}[5m]) > 0
|
||||
# for: 1s
|
||||
# labels:
|
||||
# severity: error
|
||||
# annotations:
|
||||
# summary: Redis instance {{ "{{ $instance }}" }} has evicted keys
|
||||
# description: Redis instance {{ "{{ $instance }}" }} has evicted {{ "{{ $value }}" }} keys in the last 5 minutes.
|
||||
|
||||
##
|
||||
## Init containers parameters:
|
||||
## volumePermissions: Change the owner of the persist volume mountpoint to RunAsUser:fsGroup
|
||||
|
||||
@@ -510,6 +510,46 @@ metrics:
|
||||
selector:
|
||||
prometheus: kube-prometheus
|
||||
|
||||
## Custom PrometheusRule to be defined
|
||||
## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart
|
||||
## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions
|
||||
prometheusRule:
|
||||
enabled: false
|
||||
additionalLabels: {}
|
||||
namespace: ""
|
||||
rules: []
|
||||
## These are just examples rules, please adapt them to your needs.
|
||||
## Make sure to constraint the rules to the current postgresql service.
|
||||
# - alert: RedisDown
|
||||
# expr: redis_up{service="{{ template "redis.fullname" . }}-metrics"} == 0
|
||||
# for: 2m
|
||||
# labels:
|
||||
# severity: error
|
||||
# annotations:
|
||||
# summary: Redis instance {{ "{{ $instance }}" }} down
|
||||
# description: Redis instance {{ "{{ $instance }}" }} is down.
|
||||
# - alert: RedisMemoryHigh
|
||||
# expr: >
|
||||
# redis_memory_used_bytes{service="{{ template "redis.fullname" . }}-metrics"} * 100
|
||||
# /
|
||||
# redis_memory_max_bytes{service="{{ template "redis.fullname" . }}-metrics"}
|
||||
# > 90 =< 100
|
||||
# for: 2m
|
||||
# labels:
|
||||
# severity: error
|
||||
# annotations:
|
||||
# summary: Redis instance {{ "{{ $instance }}" }} is using too much memory
|
||||
# description: Redis instance {{ "{{ $instance }}" }} is using {{ "{{ $value }}" }}% of its available memory.
|
||||
# - alert: RedisKeyEviction
|
||||
# expr: increase(redis_evicted_keys_total{service="{{ template "redis.fullname" . }}-metrics"}[5m]) > 0
|
||||
# for: 1s
|
||||
# labels:
|
||||
# severity: error
|
||||
# annotations:
|
||||
# summary: Redis instance {{ "{{ $instance }}" }} has evicted keys
|
||||
# description: Redis instance {{ "{{ $instance }}" }} has evicted {{ "{{ $value }}" }} keys in the last 5 minutes.
|
||||
|
||||
|
||||
## Metrics exporter pod priorityClassName
|
||||
# priorityClassName: {}
|
||||
service:
|
||||
|
||||
Reference in New Issue
Block a user