diff --git a/cesnet-central/playbooks/notebooks.yaml b/cesnet-central/playbooks/notebooks.yaml index 89c48abaa70d7d49a7053aa826e4d43c11d5524e..119e6769b10647df1919b624f5e611318dd902f4 100644 --- a/cesnet-central/playbooks/notebooks.yaml +++ b/cesnet-central/playbooks/notebooks.yaml @@ -118,6 +118,19 @@ with_fileglob: - "../extra/*.yaml" when: true + # Workaround for pods stuck in "Terminating" state + - name: Regular cleanup of failed user notebooks pods + vars: + name: "{{ item | basename | splitext | first }}" + cron: + cron_file: "notebooks-{{ name }}-cleaner" + name: "Notebooks {{ name }} cleanup" + minute: "*/2" + hour: "*" + job: "KUBECONFIG=$HOME/.kube/config /usr/local/bin/k8s-pods-cleaner.sh '{{ name }}' app=jupyterhub,component=singleuser-server --yes >/dev/null 2>&1" + user: egi + with_fileglob: + - "../deployments/*.yaml" - hosts: nfs become: true tasks: