feat: set Redis probes optionnal and disabled by default

Signed-off-by: François Blondel <francois.blondel@diva-e.com>
This commit is contained in:
François Blondel 2024-02-06 11:20:03 +01:00
parent 370a640df5
commit 8497df2d77
3 changed files with 76 additions and 22 deletions

View file

@ -968,8 +968,18 @@ server:
| redis.exporter.image.imagePullPolicy | string | `""` (defaults to global.image.imagePullPolicy) | Image pull policy for the redis-exporter | | redis.exporter.image.imagePullPolicy | string | `""` (defaults to global.image.imagePullPolicy) | Image pull policy for the redis-exporter |
| redis.exporter.image.repository | string | `"public.ecr.aws/bitnami/redis-exporter"` | Repository to use for the redis-exporter | | redis.exporter.image.repository | string | `"public.ecr.aws/bitnami/redis-exporter"` | Repository to use for the redis-exporter |
| redis.exporter.image.tag | string | `"1.57.0"` | Tag to use for the redis-exporter | | redis.exporter.image.tag | string | `"1.57.0"` | Tag to use for the redis-exporter |
| redis.exporter.livenessProbe | object | `{"failureThreshold":5,"initialDelaySeconds":30,"periodSeconds":15,"successThreshold":1,"timeoutSeconds":15}` | livenessProbe parameters to pass to the Redis server | | redis.exporter.livenessProbe.enabled | bool | `false` | Enable Kubernetes liveness probe for Redis exporter |
| redis.exporter.readinessProbe | object | `{"failureThreshold":5,"initialDelaySeconds":30,"periodSeconds":15,"successThreshold":1,"timeoutSeconds":15}` | readinessProbe parameters to pass to the Redis server | | redis.exporter.livenessProbe.failureThreshold | int | `5` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
| redis.exporter.livenessProbe.initialDelaySeconds | int | `30` | Number of seconds after the container has started before [probe] is initiated |
| redis.exporter.livenessProbe.periodSeconds | int | `15` | How often (in seconds) to perform the [probe] |
| redis.exporter.livenessProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
| redis.exporter.livenessProbe.timeoutSeconds | int | `15` | Number of seconds after which the [probe] times out |
| redis.exporter.readinessProbe.enabled | bool | `false` | Enable Kubernetes liveness probe for Redis exporter (optional) |
| redis.exporter.readinessProbe.failureThreshold | int | `5` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
| redis.exporter.readinessProbe.initialDelaySeconds | int | `30` | Number of seconds after the container has started before [probe] is initiated |
| redis.exporter.readinessProbe.periodSeconds | int | `15` | How often (in seconds) to perform the [probe] |
| redis.exporter.readinessProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
| redis.exporter.readinessProbe.timeoutSeconds | int | `15` | Number of seconds after which the [probe] times out |
| redis.exporter.resources | object | `{}` | Resource limits and requests for redis-exporter sidecar | | redis.exporter.resources | object | `{}` | Resource limits and requests for redis-exporter sidecar |
| redis.extraArgs | list | `[]` | Additional command line arguments to pass to redis-server | | redis.extraArgs | list | `[]` | Additional command line arguments to pass to redis-server |
| redis.extraContainers | list | `[]` | Additional containers to be added to the redis pod | | redis.extraContainers | list | `[]` | Additional containers to be added to the redis pod |
@ -978,7 +988,12 @@ server:
| redis.image.tag | string | `"7.0.15-alpine"` | Redis tag | | redis.image.tag | string | `"7.0.15-alpine"` | Redis tag |
| redis.imagePullSecrets | list | `[]` (defaults to global.imagePullSecrets) | Secrets with credentials to pull images from a private registry | | redis.imagePullSecrets | list | `[]` (defaults to global.imagePullSecrets) | Secrets with credentials to pull images from a private registry |
| redis.initContainers | list | `[]` | Init containers to add to the redis pod | | redis.initContainers | list | `[]` | Init containers to add to the redis pod |
| redis.livenessProbe | object | `{"failureThreshold":5,"initialDelaySeconds":30,"periodSeconds":15,"successThreshold":1,"timeoutSeconds":15}` | livenessProbe parameters to pass to the Redis server | | redis.livenessProbe.enabled | bool | `false` | Enable Kubernetes liveness probe for Redis server |
| redis.livenessProbe.failureThreshold | int | `5` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
| redis.livenessProbe.initialDelaySeconds | int | `30` | Number of seconds after the container has started before [probe] is initiated |
| redis.livenessProbe.periodSeconds | int | `15` | How often (in seconds) to perform the [probe] |
| redis.livenessProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
| redis.livenessProbe.timeoutSeconds | int | `15` | Number of seconds after which the [probe] times out |
| redis.metrics.enabled | bool | `false` | Deploy metrics service | | redis.metrics.enabled | bool | `false` | Deploy metrics service |
| redis.metrics.service.annotations | object | `{}` | Metrics service annotations | | redis.metrics.service.annotations | object | `{}` | Metrics service annotations |
| redis.metrics.service.clusterIP | string | `"None"` | Metrics service clusterIP. `None` makes a "headless service" (no virtual IP) | | redis.metrics.service.clusterIP | string | `"None"` | Metrics service clusterIP. `None` makes a "headless service" (no virtual IP) |
@ -1006,7 +1021,12 @@ server:
| redis.podAnnotations | object | `{}` | Annotations to be added to the Redis server pods | | redis.podAnnotations | object | `{}` | Annotations to be added to the Redis server pods |
| redis.podLabels | object | `{}` | Labels to be added to the Redis server pods | | redis.podLabels | object | `{}` | Labels to be added to the Redis server pods |
| redis.priorityClassName | string | `""` (defaults to global.priorityClassName) | Priority class for redis pods | | redis.priorityClassName | string | `""` (defaults to global.priorityClassName) | Priority class for redis pods |
| redis.readinessProbe | object | `{"failureThreshold":5,"initialDelaySeconds":30,"periodSeconds":15,"successThreshold":1,"timeoutSeconds":15}` | readinessProbe parameters to pass to the Redis server | | redis.readinessProbe.enabled | bool | `false` | Enable Kubernetes liveness probe for Redis server |
| redis.readinessProbe.failureThreshold | int | `5` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
| redis.readinessProbe.initialDelaySeconds | int | `30` | Number of seconds after the container has started before [probe] is initiated |
| redis.readinessProbe.periodSeconds | int | `15` | How often (in seconds) to perform the [probe] |
| redis.readinessProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
| redis.readinessProbe.timeoutSeconds | int | `15` | Number of seconds after which the [probe] times out |
| redis.resources | object | `{}` | Resource limits and requests for redis | | redis.resources | object | `{}` | Resource limits and requests for redis |
| redis.securityContext | object | See [values.yaml] | Redis pod-level security context | | redis.securityContext | object | See [values.yaml] | Redis pod-level security context |
| redis.service.annotations | object | `{}` | Redis service annotations | | redis.service.annotations | object | `{}` | Redis service annotations |

View file

@ -72,6 +72,7 @@ spec:
envFrom: envFrom:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- if .Values.redis.livenessProbe.enabled }}
livenessProbe: livenessProbe:
initialDelaySeconds: {{ .Values.redis.livenessProbe.initialDelaySeconds }} initialDelaySeconds: {{ .Values.redis.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.redis.livenessProbe.periodSeconds }} periodSeconds: {{ .Values.redis.livenessProbe.periodSeconds }}
@ -83,6 +84,8 @@ spec:
- sh - sh
- -c - -c
- /health/redis_liveness.sh - /health/redis_liveness.sh
{{- end }}
{{- if .Values.redis.readinessProbe.enabled }}
readinessProbe: readinessProbe:
initialDelaySeconds: {{ .Values.redis.readinessProbe.initialDelaySeconds }} initialDelaySeconds: {{ .Values.redis.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.redis.readinessProbe.periodSeconds }} periodSeconds: {{ .Values.redis.readinessProbe.periodSeconds }}
@ -94,6 +97,7 @@ spec:
- sh - sh
- -c - -c
- /health/redis_readiness.sh - /health/redis_readiness.sh
{{- end }}
ports: ports:
- name: redis - name: redis
containerPort: {{ .Values.redis.containerPorts.redis }} containerPort: {{ .Values.redis.containerPorts.redis }}
@ -126,6 +130,7 @@ spec:
- name: metrics - name: metrics
containerPort: {{ .Values.redis.containerPorts.metrics }} containerPort: {{ .Values.redis.containerPorts.metrics }}
protocol: TCP protocol: TCP
{{- if .Values.redis.exporter.livenessProbe.enabled }}
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /metrics path: /metrics
@ -135,6 +140,8 @@ spec:
periodSeconds: {{ .Values.redis.exporter.livenessProbe.periodSeconds }} periodSeconds: {{ .Values.redis.exporter.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.redis.exporter.livenessProbe.successThreshold }} successThreshold: {{ .Values.redis.exporter.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.redis.exporter.livenessProbe.failureThreshold }} failureThreshold: {{ .Values.redis.exporter.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.redis.exporter.readinessProbe.enabled }}
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /metrics path: /metrics
@ -144,6 +151,7 @@ spec:
periodSeconds: {{ .Values.redis.exporter.readinessProbe.periodSeconds }} periodSeconds: {{ .Values.redis.exporter.readinessProbe.periodSeconds }}
successThreshold: {{ .Values.redis.exporter.readinessProbe.successThreshold }} successThreshold: {{ .Values.redis.exporter.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.redis.exporter.readinessProbe.failureThreshold }} failureThreshold: {{ .Values.redis.exporter.readinessProbe.failureThreshold }}
{{- end }}
resources: resources:
{{- toYaml .Values.redis.exporter.resources | nindent 10 }} {{- toYaml .Values.redis.exporter.resources | nindent 10 }}
{{- with .Values.redis.exporter.containerSecurityContext }} {{- with .Values.redis.exporter.containerSecurityContext }}

View file

@ -1215,20 +1215,33 @@ redis:
drop: drop:
- ALL - ALL
# -- livenessProbe parameters to pass to the Redis server ## Probes for Redis exporter (optional)
livenessProbe: ## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 15
successThreshold: 1
failureThreshold: 5
# -- readinessProbe parameters to pass to the Redis server
readinessProbe: readinessProbe:
# -- Enable Kubernetes liveness probe for Redis exporter (optional)
enabled: false
# -- Number of seconds after the container has started before [probe] is initiated
initialDelaySeconds: 30 initialDelaySeconds: 30
# -- How often (in seconds) to perform the [probe]
periodSeconds: 15 periodSeconds: 15
# -- Number of seconds after which the [probe] times out
timeoutSeconds: 15 timeoutSeconds: 15
# -- Minimum consecutive successes for the [probe] to be considered successful after having failed
successThreshold: 1 successThreshold: 1
# -- Minimum consecutive failures for the [probe] to be considered failed after having succeeded
failureThreshold: 5
livenessProbe:
# -- Enable Kubernetes liveness probe for Redis exporter
enabled: false
# -- Number of seconds after the container has started before [probe] is initiated
initialDelaySeconds: 30
# -- How often (in seconds) to perform the [probe]
periodSeconds: 15
# -- Number of seconds after which the [probe] times out
timeoutSeconds: 15
# -- Minimum consecutive successes for the [probe] to be considered successful after having failed
successThreshold: 1
# -- Minimum consecutive failures for the [probe] to be considered failed after having succeeded
failureThreshold: 5 failureThreshold: 5
# -- Resource limits and requests for redis-exporter sidecar # -- Resource limits and requests for redis-exporter sidecar
@ -1260,20 +1273,33 @@ redis:
# - secretRef: # - secretRef:
# name: secret-name # name: secret-name
# -- livenessProbe parameters to pass to the Redis server ## Probes for Redis server (optional)
livenessProbe: ## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 15
successThreshold: 1
failureThreshold: 5
# -- readinessProbe parameters to pass to the Redis server
readinessProbe: readinessProbe:
# -- Enable Kubernetes liveness probe for Redis server
enabled: false
# -- Number of seconds after the container has started before [probe] is initiated
initialDelaySeconds: 30 initialDelaySeconds: 30
# -- How often (in seconds) to perform the [probe]
periodSeconds: 15 periodSeconds: 15
# -- Number of seconds after which the [probe] times out
timeoutSeconds: 15 timeoutSeconds: 15
# -- Minimum consecutive successes for the [probe] to be considered successful after having failed
successThreshold: 1 successThreshold: 1
# -- Minimum consecutive failures for the [probe] to be considered failed after having succeeded
failureThreshold: 5
livenessProbe:
# -- Enable Kubernetes liveness probe for Redis server
enabled: false
# -- Number of seconds after the container has started before [probe] is initiated
initialDelaySeconds: 30
# -- How often (in seconds) to perform the [probe]
periodSeconds: 15
# -- Number of seconds after which the [probe] times out
timeoutSeconds: 15
# -- Minimum consecutive successes for the [probe] to be considered successful after having failed
successThreshold: 1
# -- Minimum consecutive failures for the [probe] to be considered failed after having succeeded
failureThreshold: 5 failureThreshold: 5
# -- Additional containers to be added to the redis pod # -- Additional containers to be added to the redis pod