Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
keydb: scripts.cleanupCoredumps
Browse files Browse the repository at this point in the history
  • Loading branch information
Antiarchitect committed Feb 11, 2022
1 parent 8d621c6 commit 69462e0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion keydb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: keydb
description: A Helm chart for KeyDB multimaster setup
type: application
version: 0.32.1
version: 0.33.0
keywords:
- keydb
- redis
Expand Down
7 changes: 7 additions & 0 deletions keydb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ helm install keydb enapter/keydb

This chart bootstraps a [KeyDB](https://keydb.dev) highly available multi-master statefulset in a [Kubernetes](http://kubernetes.io) cluster using the Helm package manager.

## 0.33.0 Upgrade notice

As the chart is not yet production ready (0.x) backward incompatible changes can be introduced in minor releases.
Since 0.33.0 `scripts.cleanup` is obsoleted by `scripts.cleanupTempfiles`. `scripts.cleanupCoredumps` section is added in order to provide ability to cleanup `core.*` files and is disabled by default. Please look `values.yaml`.

## 0.30.0 Upgrade notice

As the chart is not yet production ready (0.x) backward incompatible changes can be introduced in minor releases.
Expand Down Expand Up @@ -103,6 +108,8 @@ The following table lists the configurable parameters of the KeyDB chart and the
| `persistentVolume.storageClass` | StorageClassName for volume | `` |
| `resources` | Resources for KeyDB containers | `{}` |
| `scripts.enabled` | Turn on health util scripts | `false` |
| `scripts.cleanupCoredumps` | Coredumps cleanup scripts | Look values.yaml |
| `scripts.cleanupTempfiles` | Tempfiles cleanup scripts | Look values.yaml |
| `securityContext` | SecurityContext for KeyDB pods | `{}` |
| `service.annotations` | Service annotations | `{}` |
| `loadBalancer.enabled` | Create LoadBalancer service | `false` |
Expand Down
28 changes: 19 additions & 9 deletions keydb/templates/cm-health.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data:
ping_readiness_local.sh: |-
#!/bin/bash
set -eo pipefail
set -e
[[ -n "${REDIS_PASSWORD}" ]] && export REDISCLI_AUTH="${REDIS_PASSWORD}"
response="$(
Expand All @@ -26,7 +26,7 @@ data:
ping_liveness_local.sh: |-
#!/bin/bash
set -eo pipefail
set -e
[[ -n "${REDIS_PASSWORD}" ]] && export REDISCLI_AUTH="${REDIS_PASSWORD}"
response="$(
Expand All @@ -46,23 +46,33 @@ data:
scripts_local.sh: |-
#!/bin/bash
set -eo pipefail
set -e
script_dir="$(dirname "$0")"
while true; do
{{- if .Values.scripts.cleanup.enabled }}
"${script_dir}/cleanup_local_data.sh"
{{- if .Values.scripts.cleanupCoredumps.enabled }}
"${script_dir}/cleanup_coredumps.sh"
{{- end }}
{{- if .Values.scripts.cleanupTempfiles.enabled }}
"${script_dir}/cleanup_tempfiles.sh"
{{- end }}
sleep 60
done
{{- end }}

{{- if .Values.scripts.cleanup.enabled }}
{{- if .Values.scripts.cleanupCoredumps.enabled }}
cleanup_coredumps.sh: |-
#!/bin/bash
set -e
cleanup_local_data.sh: |-
find /data/ -type f -name "core.*" -mmin +{{ .Values.scripts.cleanupCoredumps.minutes }} -delete
{{- end }}
{{- if .Values.scripts.cleanupTempfiles.enabled }}
cleanup_tempfiles.sh: |-
#!/bin/bash
set -eo pipefail
set -e
find /data/ -type f \( -name "temp-*.aof" -o -name "temp-*.rdb" \) -mmin +{{ .Values.scripts.cleanup.minutes }} -delete
find /data/ -type f \( -name "temp-*.aof" -o -name "temp-*.rdb" \) -mmin +{{ .Values.scripts.cleanupTempfiles.minutes }} -delete
{{- end }}
5 changes: 4 additions & 1 deletion keydb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ scripts:
enabled: false
# CPU/Memory resource limits/requests
resources: {}
cleanup:
cleanupCoredumps:
enabled: false
minutes: 1440
cleanupTempfiles:
enabled: true
minutes: 60

0 comments on commit 69462e0

Please sign in to comment.