JupyterHub Outpost will use the stored JupyterHub API token to recreate the port-forwarding process. If the API token is no longer valid, this will fail. The single-user server would then be unreachable and must be restarted by the user.
JupyterHub Outpost will use the stored JupyterHub API token to recreate the port-forwarding process. If the API token is no longer valid, this will fail. The single-user server would then be unreachable and must be restarted by the user.
```
```
## Flavors
## Flavors - manage resource access for multiple JupyterHubs
### Overview
By default, all connected JupyterHubs may use all available resources. It's possible to configure "flavors" for each connected JupyterHub, offering only a part of the available resources.
For this configuration three attributes are crucial:
**Flavors** define preconfigured resource templates for User sessions. They specify **runtime limits** and user constraints, helping you manage system load and provide differentiated access based on user groups or hub configurations.
- flavors
- flavors_undefined_max
- flavors_update_token
### Flavors
Flavors are mandatory and part of the default configuration of the Outpost. All users will have access to the default flavors unless specified otherwise.
Configure different flavors, which can be used in Spawner configuration.
```python
asyncdefflavors(jupyterhub_name):
ifjupyterhub_name=="privileged":
return{
"typea":{
"max":-1,
"weight":10,
"display_name":"2GB RAM, 1VCPU, 5 days",
"description":"JupyterLab will run for max 5 days with 2GB RAM and 1VCPU.",
"runtime":{"days":5},
},
}
else:
return{
"typeb":{
"max":10,
"weight":9,
"display_name":"4GB RAM, 1VCPUs, 2 hours",
"description":"JupyterLab will run for max 2 hours with 4GB RAM and 1VCPUs.",
"runtime":{"hours":2},
},
}
c.JupyterHubOutpost.flavors=flavors
```
The connected JupyterHub "privileged" can start infinite singleuser notebook server. The servers will be stopped after 5 days by the JupyterHub Outpost.
Any other connected JupyterHub can start up to 10 singleuser notebook server (all users together for each JupyterHub, not combined for all JupyterHubs).
The according RAM / VCPUs restrictions are configured later on in the config file at `c.KubeSpawner.profile_list` or `c.KubeSpawner.[mem_guarantee|mem_limit|cpu_guarantee|cpu_limit]`.
JupyterHub OutpostSpawner has to send the chosen flavor in `user_options.flavor` when starting a notebook server.
### Undefined Max
If JupyterHub OutpostSpawner does not send a flavor in user_options `c.JupyterHubOutpost.flavors_undefined_max` will be used to limit the available resources. This value is also used, if the given flavor is not part of the previously defined `flavors` dict. Default is `-1`, which allows infinite notebook servers for all unknown or unconfigured flavored notebook servers.
This example does not allow any notebook server with a flavor, that's not defined in `c.JupyterHubOutpost.flavors`. Enables full control of the available resources.
> Resources must be used by your Spawner Configuration.
### Update Tokens
#### Parameters
The JupyterHub OutpostSpawner offers a APIEndpoint, which receives or offers the current Flavors of all connected JupyterHub Outposts. With this function the Outpost will inform the connected JupyterHubs at each start/stop of a notebook server, about the current flavor situation. The corresponding URL will be given by the OutpostSpawner.
- All defined flavors will be available to all users.
- This behavior can be overridden by defining `users` or `hubs`.
---
### Recommendations
- Start with a base set of flavors (`minimal`, `default`) and refine access over time.
- Use `negate_authentication` for simple allow/deny matching logic based on patterns.
- Always test your regex for `username` carefully to avoid unintentional matches.
- Use `weight` wisely to control precedence in overlapping rules.
#### Use Cases
-**Blocked Users**: Administrators can configure flavors for specific users that deny access, effectively blocking them from launching any jupyter servers.
-**Prioritized Users**: For power users, administrators can assign more resources (e.g., higher CPU, additional memory) to ensure they have the performance needed for demanding tasks.
-**External Users**: For guest or external users, administrators may provide a default, minimal resource allocation to prevent overuse of the system’s resources.
#### Benefits
- Resource Management: Fine-grained control over resource allocation ensures efficient use of system resources.
- User Control: Administrators can easily adjust resource access based on user needs or status (e.g., external user vs internal user).
- Scalability: As your user base grows, you can easily apply different flavors to new users without major changes to the overall configuration.