Culling idle Kernels

I aim to terminate idle pods and kernels effectively. I have been using the following configuration in my values.yaml file to kill pods.

cull:
  enabled: true
  users: false
  adminUsers: true 
  removeNamedServers: false 
  timeout: 600
  every: 30
  concurrency: 10 
  maxAge: 0 

I need help on how to also manage and terminate idle kernels.

Kernels can only be culled from inside jupyter-server, JupyterHub can’t mange this. There’s a good explanation here:

You’ll need to create or mount a config file with the kernel culling config into your singleuser servers:
https://jupyter-server.readthedocs.io/en/latest/users/configuration.html

2 Likes

You can mount config to cull kernels via singleuser.extraFiles, this is something deployments in GitHub - 2i2c-org/infrastructure: Infrastructure for configuring and deploying our community JupyterHubs. does.

/ From mobile

Yep thx was able to do this through singleuser.extrafiles

singleuser:
  extraFiles:
    jupyter_notebook_config.json:
      mountPath: /etc/jupyter/jupyter_notebook_config.json
      data:
        MappingKernelManager:
          cull_idle_timeout: 60 
          cull_interval: 30 
          cull_connected: true
          cull_busy: false 
1 Like