Skip to main content

Task Scheduling

The Laravel Command Scheduler allows you to fluently and expressively define your command schedule within Laravel itself.

🧱 The LaraKube CLI Strategy​

In a Kubernetes environment, running a traditional cron daemon can be complex. LaraKube CLI simplifies this by creating a dedicated CronJob resource:

  1. Isolated Runner: Scheduling runs in its own lightweight pod, separate from your web workers.
  2. Deterministic Execution: It triggers php artisan schedule:run every minute, exactly as Laravel expects.
  3. Resource Efficient: The pod only exists for the duration of the scheduled task, saving cluster memory and CPU.

Configuration​

There is no extra configuration needed in Kubernetes! Simply define your schedule in routes/console.php (Laravel 11+) or app/Console/Kernel.php (Legacy), and LaraKube CLI handles the rest.

Logs​

To see the output of your scheduled tasks, you can use the K9s console (larakube console) or check the logs of the most recent scheduler pod.