Skip to content

Run a cronJob that requires env variable inside a container

Notifications You must be signed in to change notification settings

noemi-dresden/cronJob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Running cronJob with Env variable

2 different ways (docker vs k8s) to run cronjob requiring env variables inside a container.

Here what we want to do:

  • We have a script file job.sh containing the job
  • We want this script to run the script every 5 min for example

docker

  • docker buil -t my-image .
  • docker run -e $MY_ENV_VARIABLE=myValue my-image

k8s

  • docker buil -t my-image . and push the image to your-repository
  • kubectl create -f deploy.yml

About

Run a cronJob that requires env variable inside a container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published