More of a general question - Assume all my tech stack has to be on K8S (for example cloud vendor agnostic): When should I use serverless on top of K8S (e.g nuclio, kubeless) - and when to keep service as docker? I ask this because the "auto-scaling" I get for free for both of them - so I wonder when I should use another framework...
To simplify - assume everything is stateless...no sessions
I will start by saying that Serverless is more innovative technology than Docker Containers. However, they both have their advantages and disadvantages.
Starting from Serverless, it is possible to build them for virtually any type of application or backend service, and everything required to run and scale your application with high availability is handled for you.
Deployment simplicity. There’s no need to administrate infrastructure — just upload your functions, and that’s all. No Dockerfiles or Kubernetes configurations.
Almost all Serverless solutions support event triggers, which means they are great for pipelines and sequenced workflows.
As you pay per function execution, Serverless is cheaper than containers. When an application is not being used, it shuts down, and you don’t pay for the idle time (you have mentioned that you don't have to pay for auto-scaling).
When the Serverless app grows, it is hard to troubleshoot because of the way the FaaS applications are designed to work.
Serverless always depends on a third party vendor, so that changing the cloud provider can be a headache.
Docker is a containerization platform that packages your application and all its dependencies together in the docker container.
If you want to reduce application management and don’t care about the architecture - Serverless is the best option. If you want to deploy an application on specified system architecture with having control over it, then Docker containers are the best option. So when comparing Serverless vs Docker, it comes down to choosing what is better for your particular needs.
I encourage to read interesting article about it.