Open Closed

About the kubernetes multipod support... #4990


User avatar
0
cagriceylan created

Hello everyone,

We created a project with ABP Commercial. It is a project with API layer in MVC architecture. When we launch this project with multiple pods on kubernetes, we get a consistency error. Namely; When it sends a request to another pod with the token it received from one pod, we get an authorization error. Requests are inconsistently responsed and not responsed. We used sticky session for the solution, but we could not provide a complete solution. As a different solution, we want to keep the token from the api layer in redis, but we could not find an example in the forum and we cannot access the token generated code. How should we go about the issue? If there exist, can you share an example?

Thanks for your interest, Best regards

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v7.0.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): Tiered(MVC)
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

1 Answer(s)
  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    I don't think sticky session is a nice solution for this since the tiered mvc application is using jwt tokens.

    You can use ASP.NET Data Protection to store this information in a distributed cache for persistancy.

    Simply add:

    context.Services
        .AddDataProtection()
        .SetApplicationName("myApp")
        .PersistKeysToStackExchangeRedis(redis, "myApp-Protection-Keys");
    

    Library is from Microsoft.AspNetCore.DataProtection.StackExchangeRedis.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15