django-crontab icon indicating copy to clipboard operation
django-crontab copied to clipboard

Django Crontab on docker-image not reading env-variable from K8S deployment config

Open vinoalterra opened this issue 3 years ago • 1 comments

Environment & Versions

  • Operating system: Debian 5.10.46-4~bpo10+1 (2021-08-07) x86_64 GNU/Linux
  • Python: 3.8.6
  • Django: 3.1.13
  • django-crontab: 0.7.1

Settings

  • My django-crontab settings:
CRONJOBS = [
    ('* * * * *', 'transaction.cron.transactionjob'),
]

Details

  • Output of crontab -l after running python manage.py crontab add.
* * * * * /usr/local/bin/python /app/rad/manage.py crontab run 68088a22e67d51156d821934dfc83deb # django-cronjobs for rad
  • If this output contained a crontab run command and I copy this command to my terminal the job works: yes

The Problem

  • If i run task manual via python manage.py crontab run 68088a22e67d51156d821934dfc83deb => env-variables can be read correctly
  • But if crontab task executed by cron service (inside k8s container/pod) => env-variable can't be read

Any suggestion?

vinoalterra avatar Dec 03 '21 07:12 vinoalterra

Check this: https://github.com/kraiz/django-crontab/issues/130#issuecomment-1775908918

GorlikItsMe avatar Oct 23 '23 19:10 GorlikItsMe