How to run jobs sequentially by using Kubernetes and Docker

5/10/2019

I want to schedule three sequential tasks using Kubernetes. these three tasks are:

1- download a file from a URL

2- process the file

3- Put the file in a web server (The server must be configured and some modules must be installed on it first)

I think I can do this using Kubernetes jobs, but I did not find an example of doing such tasks.

In Addition, I do not know how to first configure the web server before using it. Is it possible to create a Docker image from the server, configure it and finally get a snapshot from it?

EDIT: As the first step, I just want to create a job for downloading a file. I could not find any sample for that; how can I do that?

-- sajad
docker
jobs
kubernetes

1 Answer

5/15/2019

For my opinion the most efficient and great solution nowadays is still use initContainers.

InitContainers is the best tool to handle your task in current situation. Use example provided here and implement all your tasks as initContainers.

About configuring web-server and further container usage: There are a lot of articles that provide step-by-step instruction on how to create own Docker image. I can recommend you use as an example Steps To Build Apache Web Server Docker Image article.

-- VKR
Source: StackOverflow