Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cron updates to support running multiple instances on a Kubernetes cluster #484

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gs-kamnas
Copy link
Contributor

This change implements a series of features designed to support running this container in a distributed manner where multiple instances are running to support a single instance of LibreNMS, including:

  • Adds the DISABLE_DB_MIGRATE and DISABLE_CRON environment variable flags that may be used to disable automatic database migration as well as running cron such that these features can be run as separate Kubernetes jobs if desired.
  • Adds feature to source /data/cron-pre-hook into the shell environment if present prior to cronjob execution. This can be leveraged in combination with the leader-elector Kubernetes or a simple test of the index of the pod in a statefulset in order to ensure that only one container is running the cronjobs.
  • Adds cronjob to run laravel's scheduled tasks as it was observed that these were not being run in containerized deployments.

…loyment

Support pre-cronjob hooks to enable running cronjobs conditionally (such
as on the 0th pod of a Kubernetes statefulset).
@gs-kamnas gs-kamnas requested a review from crazy-max as a code owner January 17, 2025 23:44
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.

1 participant