Is there any way using k8s or swarm or any other option to automate the spawn of containers according to requests.
Part of my project is to send an event to an eventbus (rabbitMQ) which has a listener to the events once an event arrives then start a new container for each message.
The only option I found was to mount the host engine to the event listener container that and I don't really like this solution.
I would like an orchestrator to "listen" to the eventbus or to any other request queue container spawn requests and start them.
Thank you
This is a broad question, there are many ways on you can accomplish this.
For example:
Write a simple bash script on an infinite loop that gets a message from RabbitMQ using another program (perhaps written python with Pika). As soon as it gets a message, issue a docker run ...
Write your own program with Pika that waits for a message and then creates a pod in Kubernetes using the python K8s client.
You can also use any other language that has a client API for RabbitMQ, Docker, and/or Kubernetes.