dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.94k stars 482 forks source link

Ability to change replica count on dashboard in Runtime #4358

Open MadL1me opened 5 months ago

MadL1me commented 5 months ago

Overview

To test failover scenarios (for example in this case: https://github.com/dotnet/aspire/issues/4357) first-class support for changing replica count in dashboard would be very helpful

This feature can be implemented closely with https://github.com/dotnet/aspire/issues/295, because two scenarios are very similar (restart is basically scaling pods to 0 and than back to replica_count)

For example, we can start with ReplicaCount = 3 for service, but we can change it to "0" and "4", for example. This will insanely help with testing scenarios of failovers locally - test what happens if you just turn off the database, and than rescale it

This would like smth like this:

image_2024-06-02_00-06-29

This will also resolve issue https://github.com/dotnet/aspire/issues/3095 - as one of the ways to perform "complete stop" of the service (or even restart, after some time, with specified replica count we want)

However, It seems easy to add this feature for .NET apps, but it's might be not so trivial for applications where nodes are required to be in state of consensus (any leader-election, multimaster or master-replica architecture) (for example Kafka or Postgres), because it might be required to add info to all brokers/servers about new added host.

mitchdenny commented 5 months ago

Yes this is something we definitely want to do. Adding it to the backlog for now.

adamint commented 5 months ago

We should create a meta replica set issue, which should include this one.