# Different resource limits for different user groups

**URL:** https://discourse.jupyter.org/t/different-resource-limits-for-different-user-groups/15922
**Category:** Zero to JupyterHub on Kubernetes
**Created:** [September 23, 2022, 6:57pm UTC](https://discourse.jupyter.org/t/different-resource-limits-for-different-user-groups/15922 "2022-09-23T18:57:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![llacurcia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/llacurcia/32/11586_2.png) [@llacurcia](https://discourse.jupyter.org/u/llacurcia)
#### Post date: [September 23, 2022, 6:57pm UTC](https://discourse.jupyter.org/t/different-resource-limits-for-different-user-groups/15922/1 "2022-09-23T18:57:12Z")

</div>

Hello, I want to deploy Jupyterhub on kubernetes and have different resource limits defined for different group of users. Is this possible?

Thanks!

---

<div class="post-metadata">

### Author: ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)
#### Post date: [September 24, 2022, 8:16pm UTC](https://discourse.jupyter.org/t/different-resource-limits-for-different-user-groups/15922/2 "2022-09-24T20:16:38Z")

</div>

It’ll require some testing, but I think you can do it using a `pre_spawn_start` to modify the spawner parameters. There’s an example of modifying `spawner.environment` in

> [@How to pass access\_token from Auth0 to the user's pod?](https://discourse.jupyter.org/t/how-to-pass-access-token-from-auth0-to-the-users-pod/14231/2):
>
> I have found the solution. Here is what I made : hub: extraConfig: oauth.py: | from oauthenticator.auth0 import Auth0OAuthenticator from tornado import gen class CustomAuth0OAuthenticator(Auth0OAuthenticator): async def pre\_spawn\_start(self, user, spawner): spawner.log.debug('BEGIN pre\_spawn\_start') auth\_state = await user.get\_auth\_state() spawner.environment['ACCESS\_TOKEN'] = auth\_state['access\_token'] spawner.environment[…

but you should be able to modify other KubeSpawner properties, such as the resource limits.

---

<div class="post-metadata">

### Author: ![moriabs88](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/moriabs88/32/13475_2.png) [@moriabs88](https://discourse.jupyter.org/u/moriabs88)
#### Post date: [May 27, 2024, 9:01am UTC](https://discourse.jupyter.org/t/different-resource-limits-for-different-user-groups/15922/3 "2024-05-27T09:01:04Z")

</div>

Hi, you have an example how that can be achieved?

We need to have the ability to define for each group resource limits so they will not take resources from other groups
