Launching and shutting down an application based on authenticated user activity

There are applications and services in enterprises that do not have to constantly work and have a limited user base (say, a few people).

These applications can be disabled and launched either on the basis of planning, or even more efficient work with the user. So, we are talking about an on-demand service (say, wrapped in a container) and node start up and shutdown.

Now, first of all, to mention that the reason why I mention authenticated user activity is that it makes sense to start and stop on this basis (i.e. not based on lower-level network traffic). You can imagine that corporate SSO is involved (for example, OAuth 2).

So my question is: did anyone try to implement what I described using Consul or Kubernetes?

In the case of Consul, it may happen that the key value repository can be used to provide TTL classes to the classes (ie a small user base), each time an authenticated user requests access to this Micro, this TTL application is updated . During the TTL window, we want to check the operation of node (s), containers and services - outside the window that we donโ€™t have (since we want to save it to op ex).

This question is similar to this question about autoscaling , but it differs in that this use case concerns scaling from 0 nodes and then to 0 based on an authenticated user base (most likely, SSO is used).

+1
source share
1 answer

In the case of Kubernetes, the Horizontal Auto Scan Subsystem lists the exact use case described in the Next Steps section (that is, the function is behind and may be implemented after version 1 of Coubernes). The description of the function ( Unidling clause ) is as follows:

Scale the number of pods starting from 0. All pods can be turned off and then turned on when there is demand for them. When a service request is received without any containers, kube-proxy will create an event for the autoscaler to create a new module.

Basically, maybe I will do what I described in the future using Kubernetes, but now this is not possible. This in itself does not take into account the requirement of scaling from only 0 based on authenticated user activity.

It is worth noting that the cluster agnostic aside, the activation of the container on demand based on systemd . Of course, this solution will not decrease to 0 without a management process, but it is still worth noting.

+1
source

Source: https://habr.com/ru/post/1239887/


All Articles