Resource quota per user, jupyterhub

Hi Team,

Our Environment is working fine. But we are unable to create Resource quota per user.

Please share the method/process/Logic for achieving the requirement.

THank You
Atul YAdav

Assuming you aren’t using named servers (where one user can have more than one server) and you’re using KubeSpawner then you can use the profileList feature to restrict resources (and the notebook image to use) based on profile.

We have a custom authenticator to tie back into the auth system on our platform which has user profiles (we have two levels of “open” users and also “in-network” [paying] users). Given the token we get the user profile from the platform authenticator and then depending on their profile we can restrict resource guarantees and limits on their notebook server pod using the KubeSpawner.profileList. We don’t present users with the list of profiles, but we pass them through extraEnv so the custom authenticator code (running in the hub container) can use it to select the profile based on the user profile on the platform.

If you needed to set quota on a group of users then you could do something similar but you’d need to have some custom tooling to hook into your backend auth/quota system.

To be clear, I think you can still use the profileList feature with named servers, but I would expect your quota calculations to change if a user can have more than one pod, e.g. if the memory limit for the user is 8GB and they can have named servers, then you’d have to slice that 8GB limit up by the number of pods the user has (and maybe taking into account some guarantee).