Michael Schmid ·
May 29, 2019 · 2 min read
Cron Jobs in Kubernetes
Our Applications use Cron Jobs to run admin tasks like publishing content or cleaning up a database. Currently, we use an always running container, even though most of the time it isn’t in use, which adds a significant amount of load to each server. We are changing this process to increase efficiency for all of our clusters and clients.
When we first started building Lagoon, we played with the idea of using a Cron Job specific container only when it was actually needed, but ran into problems if the container failed, resulting in a pile-up of errors as the job tried to run over and over. The system within Kubernetes wasn’t ready for such a flexible solution. Happily, that is no longer the case!
By integrating the native Cron Job feature of Kubernetes into Lagoon, we can reduce the load on all of our servers. Clients using Lagoon on their dedicated or on-premises servers will also notice a significant reduction in the number of containers needed to host their sites, leading to savings in both resources and costs. Additionally, logs of the Cron Jobs will soon be available in the Lagoon UI, giving developers the ability to see what was performed when and if any of them failed.
This change won’t require any updates or installation for Lagoon users. You can read more here.
Contributions and community are at the heart of any open source project and we’re always excited to see how people are using and improving Lagoon. As we build new features and make improvements, we work to keep our documentation up to date and useful. We’d like to thank all the contributors who have added or improved documentation lately, including Dan Lemon, Keith Bremner, Chris Cook, Wolfgang Ziegler, Gareth Hall, Thomas Speer, Toby Bellwood, Ákos Maróy, Bastian Widmer, and Brandon Williams.
For more information on new Lagoon updates and features, check out our latest release notes.