Sticky Session Controller for Kubernetes
How to implement a sticky session controller for kubernetes with .net6 and YARP.
In this post I want to show an implemention of a sticky session controller for kubernetes in .net6. Some ingress controller for kubernetes support sticky session handling, like Traefik. The provided solution for Traefik is based on cookies. But what if a client can not handle cookies? Or a more complex strategy is needed to find the right instance of a pod?
Change database connection based on path to support multitenancy
How to change the database connection string in the DbContext of an ASP.NET Core application based on the path.
In this post I want to show an implemention of a lightweight multitenancy solution with ef core. The solution will use a database per tenant and the database connection is set up on every request based on the path. The first part of the path is the tenant id and is used as the database name.