I want to run a kubernetes job which runs some python code and dies.
The job will run only in master node.
I want this job to be light and fast.
I think there can be some ways to do this,
Make a Dockerfile that contains (python, pip packages I need, and python source code).
- With this, I have to manage Dockerfile only, but is it OK if I manage Dockerfile and source code at the same time?
Make a Dockerfile that contains (python, pip packages I need), and run container with python source code mounted with -v option.
- With this, I always have to get up-to-date source code on master node.
Make a Dockerfile that contains (python, pip packages I need, and getting python source code from my git repository).
- I think this is the best way in terms of version management, but it could be slower than ways above.
Can you give me some advise about this concern?
Or there is better way?