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,180 points
431 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
• 50,110 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
489 views
0 votes
1 answer

What all components run inside a worker node to provide a kubernetes runtime environment?

Node components run on every node, maintaining ...READ MORE

answered Jul 24, 2019 in Kubernetes by Sirajul
• 45,590 points
104 views
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, 2019 in Kubernetes by lyza
8,255 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, 2019 in Others by anonymous
4,242 views
+3 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 11, 2019 in Kubernetes by Kalgi
• 50,110 points

reshown Apr 12, 2019 by Kalgi 1,152 views
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
• 50,110 points
44 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
• 50,110 points
424 views