Draft: Feat/k8s job
Data sharing between api and job
- Add an internal API endpoint from which a job can request the data, e.g.
/internal/give-me-all-data-for-job?id=<job id goes here>
- Add an init container to the job which pulls the required data from the api created in the previous step. So the init container would call
internal/give-me-all-data-for-job?id=123
and store the data. Example: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#init-containers-in-use - The init container shares the data with the main container (i.e. image
maldep
) via a volume. This doesn’t have to be any special volume, a plain oldemptyDir
volume works. https://kubernetes.io/docs/tasks/access-application-cluster/_print/#creating-a-pod-that-runs-two-containers