django-crontab
django-crontab copied to clipboard
Django Crontab on docker-image not reading env-variable from K8S deployment config
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 runningpython 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?
Check this: https://github.com/kraiz/django-crontab/issues/130#issuecomment-1775908918