Laravel Horizon not executing pending jobs - Kubernetes and Docker environment Laravel Horizon not executing pending jobs - Kubernetes and Docker environment kubernetes kubernetes

Laravel Horizon not executing pending jobs - Kubernetes and Docker environment


After struggling for days, I got the answer to this problem.

While using Redis as a cache, queue, or broadcast broker in the docker environment, we need to make sure that the following environment variables are defined properly and they must be the same across all the pods.

  • CACHE_PREFIX
  • REDIS_PREFIX
  • REDIS_CACHE_DB
  • HORIZON_PREFIX

Hope this will help others trying to deploy the Laravel apps using Kubernetes and Docker.


In my case, I need to change my app environment from prod to production

APP_ENV=production


Double check your APP_ENV matches one of the environments in the horizon.php config. Otherwise horizon will not start any queue workers.

By default only local and production environments are provided:

https://laravel.com/docs/8.x/horizon#environments