ory/k8s

Add support for `hydra janitor` in the Hydra Helm chart

ste93cry opened this issue · 2 comments

Preflight checklist

Describe your problem

Some tables of the database of Ory Hydra keep growing in an unbounded manner, leading to a lot of stale rows that can be cleaned up after some time passed. For this reason, the hydra janitor command was born, which can be run as a cron job to purge the data from the database. Unfortunately, the Helm chart does not provide any out-of-the-box way to schedule such job.

Describe your ideal solution

Provide a CronJob resource in the Helm chart that can be enabled and configured via Helm values to execute the hydra janitor command. It should be possible to configure how often the cron job runs and which kind of things it should clean up: tokens, requests or grants (any combination of them). It should also be possible to configure the main options supported by the command, e.g. the refresh token lifespan or the batch size.

Workarounds or alternatives

Keep things as-is and leave the implementation of the cron job to the customers

Version

0.25.3

Additional Context

I could be able to work on a contribution

Hi there!
I agree that we could provide the framework of the cronjob in the helm chart, but the only sane config we could deliver would be an empty one. We should not enable the option to delete anything by default, as it may lead to undesired situations.

Absolutely agree, I didn't mean to enable it by default, I just wanted to provide the cron job definition and make it configurable in the chart.