Service Instance Pause #245

Closed
opened 2025-10-23 12:49:51 +00:00 by tobru · 5 comments
Owner

Stories

As a user, I want to pause a service instance

Implementation Notes

Pausing a service instance allows the user to stop it from running, instead of directly deleting it. This is a prerequisite for #235 and #236.

This first needs to be implemented on the control-plane, then we know in more detail how to do it in the portal. Internal ref: APPCAT-847. (Done)

It is done by setting the field spec.parameters.instances to 0.

  • Add a button to the service detail view besides the "Edit" button called "Pause" which sets this parameter to 0. We also should track this in the database so that we can show the pause state easily in the list view or in the dashboard. When the service is paused, change the button to "unpause".
  • Add an admin action in the Django admin interface that allows to pause all instances of an organization.

Questions:

  • How do we make sure that settings in the database like this "Pause" are guaranteed to reflect reality? In theory, the service instance could be unpaused in the control-plane circumventing the portal, which would cause a deviation of the reality. Should we poll (reconcile) the control-plane regularly to check if everything is still as it should be? -> We don't store it in the DB for now but directly query the control-plane. This also means no change to the instance listing for now.
  • Should we store the previous value of spec.parameters.instances so that we can set the same value again on unpause? Or just set it to 1 and let the user restore the original size? -> Just set it to 1 for now, we can change this later if required.
  • Should we make the pause functionality configurable per service definition? I.e. allow disabling the possibility to pause/unpause? And depending on APPCAT-847 allow to configure the exact field to set to 0 on pause? Maybe we want to make the field configurable anyway: When it's configured, pause is possible, when its not configured then pause isn't available. -> No, we hardcode the field for now and assume every service supports it.
## Stories _As a user, I want to pause a service instance_ ## Implementation Notes Pausing a service instance allows the user to stop it from running, instead of directly deleting it. This is a prerequisite for #235 and #236. ~~This first needs to be implemented on the control-plane, then we know in more detail how to do it in the portal. Internal ref: [APPCAT-847](https://vshnticket.atlassian.net/browse/APPCAT-847).~~ (Done) It is done by setting the field `spec.parameters.instances` to 0. - Add a button to the service detail view besides the "Edit" button called "Pause" which sets this parameter to 0. ~~We also should track this in the database so that we can show the pause state easily in the list view or in the dashboard.~~ When the service is paused, change the button to "unpause". - Add an admin action in the Django admin interface that allows to pause all instances of an organization. _Questions_: * How do we make sure that settings in the database like this "Pause" are guaranteed to reflect reality? In theory, the service instance could be unpaused in the control-plane circumventing the portal, which would cause a deviation of the reality. Should we poll (reconcile) the control-plane regularly to check if everything is still as it should be? -> We don't store it in the DB for now but directly query the control-plane. This also means no change to the instance listing for now. * Should we store the previous value of `spec.parameters.instances` so that we can set the same value again on unpause? Or just set it to 1 and let the user restore the original size? -> Just set it to 1 for now, we can change this later if required. * Should we make the pause functionality configurable per service definition? I.e. allow disabling the possibility to pause/unpause? And depending on APPCAT-847 allow to configure the exact field to set to 0 on pause? Maybe we want to make the field configurable anyway: When it's configured, pause is possible, when its not configured then pause isn't available. -> No, we hardcode the field for now and assume every service supports it.
Author
Owner

FTR: Backend is ready!

FTR: Backend is ready!
Member

We'll need answers to the open questions, at least the polling and restore questions (we can work out if it should be configurable later, imo).

We'll need answers to the open questions, at least the polling and restore questions (we can work out if it should be configurable later, imo).
Author
Owner

Answers provided.

Answers provided.
Member

Do we handle paused instances differently with regards to instance limits? Currently we handle instance limits per instance object, ignoring spec.parameters.instances entirely. Should we change this? Or do paused instances simply continue counting towards the instance limit?

Should we show the pause status on the instance list page as well? We don't currently retrieve k8s data on the instance list page, but we could lazy-load it after initial page load.

Do we handle paused instances differently with regards to instance limits? Currently we handle instance limits per instance object, ignoring `spec.parameters.instances` entirely. Should we change this? Or do paused instances simply continue counting towards the instance limit? Should we show the pause status on the instance list page as well? We don't currently retrieve k8s data on the instance list page, but we could lazy-load it after initial page load.
rixx referenced this issue from a commit 2026-02-12 17:06:21 +00:00
rixx referenced this issue from a commit 2026-02-12 17:32:09 +00:00
tobru referenced this issue from a commit 2026-02-13 14:20:23 +00:00
Author
Owner

Do we handle paused instances differently with regards to instance limits? Currently we handle instance limits per instance object, ignoring spec.parameters.instances entirely. Should we change this? Or do paused instances simply continue counting towards the instance limit?

Right now we keep the situation as it is, we count the number of instances, independent of their state. This is something we might adjust later.

Should we show the pause status on the instance list page as well? We don't currently retrieve k8s data on the instance list page, but we could lazy-load it after initial page load.

I'll create a follow-up issue to show more information on the list page.

> Do we handle paused instances differently with regards to instance limits? Currently we handle instance limits per instance object, ignoring spec.parameters.instances entirely. Should we change this? Or do paused instances simply continue counting towards the instance limit? Right now we keep the situation as it is, we count the number of instances, independent of their state. This is something we might adjust later. > Should we show the pause status on the instance list page as well? We don't currently retrieve k8s data on the instance list page, but we could lazy-load it after initial page load. I'll create a follow-up issue to show more information on the list page.
tobru closed this issue 2026-02-13 14:22:25 +00:00
Sign in to join this conversation.
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
servala/servala-portal#245
No description provided.