Environment Variables inside a Cronjob in Kubernetes

0 votes

I have a nodejs application that runs every week 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 ?

Sep 18, 2018 in Kubernetes by lina
• 8,110 points
247 views

1 answer to this question.

0 votes
Ofcourse you can. Cron job specification is very similar to pod specification. You can define environment variables just the way we do for pods.
answered Sep 18, 2018 by Kalgi
• 41,660 points

Related Questions In Kubernetes

0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,280 points
359 views
0 votes
1 answer
0 votes
1 answer
0 votes
3 answers

Using multiple commands in a kubernetes yaml file

Try something like this: containers: - name: ...READ MORE

answered Apr 23 in Kubernetes by lyza
5,639 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
2,585 views
+3 votes
1 answer
0 votes
1 answer

Running a cronjob in kubernetes

You will find the CronJobresource in the batch/v1beta1 API group. ...READ MORE

answered Sep 6, 2018 in Kubernetes by Kalgi
• 41,660 points
33 views
0 votes
1 answer

Running A cronjob in a pod in Kubernetes

Unfortunately, you cannot run the CronJob inside a container ...READ MORE

answered Sep 17, 2018 in Kubernetes by Kalgi
• 41,660 points
281 views