How to set singleuser container_security_context within helm values.yaml in z2jh

Hi,

I was wondering how I can set singleuser container_security_context from within values.yaml file in z2jh? in other words, what is the equivalent of spawner.container_security_context = {"capabilities": {"drop": ["ALL"]}} there?

I couldn’t find something like:

singleuser:
  containerSecurityContext:

in the source code.

best

I think you best option is to use one of the config overrides:

hub:
  config:
    KubeSpawner:
      extra_container_config:

https://jupyterhub-kubespawner.readthedocs.io/en/latest/spawner.html#kubespawner.KubeSpawner.extra_container_config

1 Like

But doesn’t c.KubeSpawner.extra_container_config = Dict() apply to singleuser pods? what if I want to apply this to single users pod?

If you only want to change it for a single user you’ll need to define a custom Python hook, e.g. write a pre_spawn_hook to modify the spawner properties
https://jupyterhub-kubespawner.readthedocs.io/en/stable/spawner.html#kubespawner.KubeSpawner.pre_spawn_hook

1 Like