Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for duration based licenses on Kinds #1413

Open
devdattakulkarni opened this issue Mar 10, 2025 · 1 comment
Open

Support for duration based licenses on Kinds #1413

devdattakulkarni opened this issue Mar 10, 2025 · 1 comment

Comments

@devdattakulkarni
Copy link
Contributor

Currently KubePlus supports license definition for a Kind based on number of application instances that can be created and absolute time when an application instance can be created.

Occassionally, it might be useful to define a license that is duration-based. For instance, TrialKind can be associated with a license of "one month". This would mean that an application instance created for the TrialKind will be "in-license" for a period of one month after it is created.

@devdattakulkarni
Copy link
Contributor Author

devdattakulkarni commented Mar 10, 2025

One approach to implement this will be as follows:

We will implement a licensemanager component, whose job will be to go through all the Kinds registered by KubePlus and find the Kinds that have defined a duration-based license. For such a Kind, find all the application instances, and check their age. If the instance age is past the defined duration, then mark the application instance as "out-of-license".

In the status dictionary for the app instance, we will need to include a field "license-status". If no license is defined for a Kind, then this field will be empty. Otherwise, it will have values "in-license" or "out-of-license" depending upon the license status.
The status dictionary update will need to happen here

The licensemanager component can be included as part of helmer as a separate func that sleeps for sometime, wakes up and does its work, and goes back to sleep. The reason helmer will be a good place to add this functionality is because we already have code to update an object's status in helmer.

Current license implementation is in kubeconfiggenerator.py

We can move this implementation to helm-pod so that all the license implementation is in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant