Running 'php artisan schedule:run' for Laravel in Kubernetes CronJobs
I am working on integrating a few Laravel PHP applications into a new Kubernetes architecture, and every now and then we hit a little snag. For example, the app developers noticed that when their cron job ran (php artisan schedule:run
), the MySQL container in the cluster would drop an error message like:
2019-03-27T16:20:05.965157Z 1497 [Note] Aborted connection 1497 to db: 'database' user: 'myuser' host: '10.0.76.130' (Got an error reading communication packets)
In Kubernetes, I had the Laravel app CronJob set up like so: