I have a nodejs application that runs every month and fetches data from an external database. It has some environment variables. Can I run this as a Cronjob in Kubernetes and is it possible to define env variables and also source the env variable from secretfile in the cronjob ?
Asked
Active
Viewed 3,963 times
1 Answers
1
Ofcourse, CronJob spec takes the same template as Pod spec. This means you can specify env variables (reference from secrets or config maps) just like you would do it for a Pod.

tselvan
- 642
- 3
- 11
-
So I am trying to pull the image from private gitlab repository in a cronjob. It is not accepting the imagePullSecrets tag and when I run without it it fails to fetch the image and gives an Image pull error – Anshul Tripathi Mar 28 '18 at 14:19