I have some docker images and I want to run them in a Kubernetes cluster when I receive a http request.
How I could do that? I would need to create a flask app for example that would be listening for requests and then when a request is received execute a bash command to deploy and run these images from a registry?
Or there is another easy way to achieve this?
If you have a flask app, you can use the Kubernetes python api to create Kubernetes pods or jobs. They have an example of creating a deployment here based on a yaml file that exists, but you also could define the yaml within your code or use their api spec. Their Deployment example is below, but again you would probably want to use Pods or Jobs.