Skip to content

Conversation

@renan
Copy link

@renan renan commented Oct 7, 2025

  • Add snapshot configuration section to values.yaml with:

    • Enable/disable toggle
    • Cron schedule configuration
    • Format selection (dragonfly/rdb)
    • Cleaner settings (image, interval, max count, resources)
  • Add snapshot-cleaner sidecar container to pod template:

    • Automatically removes old snapshots based on max_count
    • Supports both dragonfly (.dfs) and rdb formats
    • Configurable cleanup interval and resource limits
  • Add snapshot cron arguments to main dragonfly container

  • Maintains backward compatibility with existing configurations

Fixes #2824

@BorysTheDev BorysTheDev requested a review from kostasrim October 8, 2025 07:04
@romange romange requested review from Abhra303 and removed request for kostasrim October 14, 2025 21:10
- Add snapshot configuration section to values.yaml with:
  - Enable/disable toggle
  - Cron schedule configuration
  - Format selection (dragonfly/rdb)
  - Cleaner settings (image, interval, max count, resources)

- Add snapshot-cleaner sidecar container to pod template:
  - Automatically removes old snapshots based on max_count
  - Supports both dragonfly (.dfs) and rdb formats
  - Configurable cleanup interval and resource limits

- Add snapshot cron arguments to main dragonfly container
- Maintains backward compatibility with existing configurations
- -c
- |
while true; do
{{- if eq .Values.snapshot.format "dragonfly" }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be "df" instead of "dragonfly" as you are keeping only two formats "df" and "rdb" from the comment below.

while true; do
{{- if eq .Values.snapshot.format "dragonfly" }}
# Keep only the last {{ .Values.snapshot.cleaner.max_count }} snapshots (composed of two files each)
ls -1t /data/dump-*.dfs | tail -n +{{ add 1 (mul .Values.snapshot.cleaner.max_count 2) }} | xargs rm -f
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tested provisioning this container locally? Just want to be sure this script works.

- "--snapshot_cron"
- "{{ .Values.snapshot.schedule }}"
{{- if eq .Values.snapshot.format "rdb" }}
- "--nodf_snapshot_format"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romange do we have this flag? I think --df_snapshot_format=false is the correct flag to have rdb format?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's equivalent, though I am surprised that people know this notion as it is a special format for boolean flags in google flags library :) @renan how did you know? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: Allow setting amount of snapshots (logrotate for snapshots)

3 participants