Sticky Session Controller for Kubernetes

Posted on November 3, 2022
.net6  csharp  Kubernetes  YARP 
Sticky Session Controller for Kubernetes header image

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?

Read More


Change database connection based on path to support multitenancy

Posted on November 19, 2019
ASP.NET Core  csharp 
Change database connection based on path to support multitenancy header image

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.

Read More