feat(clickhouse): db cleanup #1876
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new automated cleanup process for ClickHouse tables in Snuba, configurable via Helm chart values. The main changes add a CronJob resource for periodic cleanup, enable flexible table selection (auto-detection or fallback list), and provide configuration options for scheduling, retention, and resource management. It also adds a dedicated ServiceAccount for the cleanup job.
ClickHouse Cleanup CronJob Implementation:
cronjob-clickhouse-cleanup.yaml
that creates aCronJob
to periodically delete old data from ClickHouse tables based on a configurable retention period. The job supports auto-discovery of tables using include/exclude regex patterns, with a fallback hardcoded list if auto-detection fails.snuba.cleanup
invalues.yaml
to control job scheduling, retention period, resource limits, table selection patterns, and other pod/job settings.ServiceAccount and Permissions:
serviceaccount-clickhouse-cleanup.yaml
to create a dedicated ServiceAccount for the cleanup job, with customizable annotations and token settings.Cleanup and Refactoring:
symbolicator.cleanup
section fromvalues.yaml
to avoid confusion and maintain chart clarity.