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

Basic user quotas #637

Closed
zsinnema opened this issue Nov 25, 2022 · 1 comment · Fixed by #641
Closed

Basic user quotas #637

zsinnema opened this issue Nov 25, 2022 · 1 comment · Fixed by #641
Assignees
Milestone

Comments

@zsinnema
Copy link
Contributor

zsinnema commented Nov 25, 2022

Implement basic application user quotas based on Keycloak user / group attributes

base quotas are stored in the application in the values.yaml within the harness tree
the application can get the quotas and responds according to the quotas

example for Jupyterhub

harness:
  quotas:
    # sets the maximum number of workspaces for the user
    quota-ws-max: 5
    # sets the maximum number of workspaces open concurrently
    quota-ws-open: 3
    # sets the cpu guaranteed on a single workspace
    quota-ws-guaranteedcpu: 1
    # sets the cpu limit on a single workspace
    quota-ws-maxcpu: 1
    # sets the memory guaranteed on a single workspace
    quota-ws-guaranteedmem: 1
    # sets the memory limit on a single workspace
    quota-ws-maxmem: 1.5G
    # sets the storage dedicated to the user data
    quota-storage-max: 1G
...
@zsinnema zsinnema self-assigned this Nov 25, 2022
@zsinnema zsinnema added the enhancement New feature or request label Nov 25, 2022
@filippomc filippomc added this to the v2.1.0 milestone Nov 25, 2022
@zsinnema
Copy link
Contributor Author

the algorithm for determinating the correct quota values will use the biggest (max) quota on the lowest leaf of the quota
the quotas on user attributes will be of highest order (they will overrule the group quotas)

example with group and subgroups:
/Base {'quota-ws-max': 12345, 'quota-ws-maxcpu': 50, 'quota-ws-open': 1}
/Base/Base 1/Base 1 1 {'quota-ws-maxcpu': 2, 'quota-ws-open': 10}
/Base/Base 2 {'quota-ws-max': 8, 'quota-ws-maxcpu': 250}
/Low CPU {'quota-ws-max': 3, 'quota-ws-maxcpu': 1000, 'quota-ws-open': 1}

result: {'quota-ws-maxcpu': 1000, 'quota-ws-open': 10, 'quota-ws-max': 8}

quota-ws-maxcpu from path "/Low CPU" results in
--> overrules paths "/Base/Base 1/Base 1 1" and "/Base/Base 2" (higher value)
--> /Base quota-ws-max is not used because this one is not the lowest
leaf with this attribute (Base 1 1 and Base 2 are "lower")
quota-ws-open from path "/Base/Base 1/Base 1 1"
quota-ws-max from path "/Base/Base 2"

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

Successfully merging a pull request may close this issue.

2 participants