jupyterhub / kubespawner

Kubernetes spawner for JupyterHub
https://jupyterhub-kubespawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
541 stars 303 forks source link

Log k8s Events related to spawned pods if we expect failures #710

Open consideRatio opened 1 year ago

consideRatio commented 1 year ago

If a case where spawn failes, or a server crashes unepectedly, its good if we log recent k8s Events.

spawner.stop() is called even if start() has failed. Min suggests we look there for anything but exit status 0 and status Running, in that case we provide additional logs about the situation using information in k8s Event resources associated with the pod.

It may be relevant to get the logs from the container as well.

Two reasons for crashing:

Motivation