How to Run Pre pod before the actual jupyter server is start?

Hi,
we are planning to run pre configuration before the actual jupyter server starts.
Yes, We have init container, but we are passing some sensitive information as a configuration, inti container will stay inside the kubernetes.
My objective is run the pod and clean it once its succussed

could you please help me here ?

Also k8s jobs also fine

It’s not clear to me what your requirements are, e.g. what needs to be configured/modified? Is it the jupyter server that needs to be configured, or is it a separate external resource? Is it a problem for the init container to remain if the user can’t access it?

I would like to run a job before the jupyter notebook starts.

JupyterHub spawners support a pre_spawn_hook

Perhaps you could add a hook to create a K8s job?

Yes, I need create k8s job. Can use then pre_spawn_hook ?

It should be possible. pre_spawn_hook takes the spawner as it’s argument. This should give you access to a Kubernetes Client:

I think you should be able to create your own client in a similar way if necessary.