1

I am looking to deploy a SaaS app using Kubernetes to handle the scaling. After much reading, I have come to the conclusion that multi-instance is the way to go. Ideally, I will have a user log-in and when they have authenticated, a new instance (I suppose this is a pod) will be launched and in that pod they will find the data that they worked on previously. The data will be stored in a database, ideally a separate database for each user, but maybe just one large one.

Multi-instance is a good choice because the app will allow the user to launch a Python job that runs in the pod, so having isolation from other users is very important.

I have searched all over, but I can't find many examples of multi-instance implementations. If anyone could point me to some good examples that would be great.

I imagine that I will have a separate pod running which will be the login page front end and then a simple back-end that will allow me to launch the pod.

But ... how do I tell the new pod which customer the pod is for and invoke the correct database?

Can I modify the pod template on the fly? and how do I pass the customer information, as an environment variable?

How then would I make sure I connect in the correct database for that customer?

Sorry if these are very basic questions. The implementation will be small to start off with, but I want to do my best to ensure that I have chosen the correct architecture.

Thanks in advance for any help or comments.

Ross Addinall
  • 41
  • 1
  • 1
  • 4

1 Answers1

0

This makes sense, but with k8s it is easier to scale up multi-tenant apps just by replicating inter-exchangeable pods. It does not have the multi-instance logic by itself.

So you’d have to actually implement this application to handle auth, create deployments based on app templates, configure them via environment variables, assign them to users and manage their persistent storage.

We have similar requirements and even after 1.5 years you posted your question there’s not much publicly available on this topic. That’s why we have made public and open-source a small prototype of this “manager” app (shameless plug), it’s here: https://gitlab.com/simevo/juggler

paolog
  • 1