Hello, members.
What I would like to achieve
I would like to display a maintenance page before starting scheduled maintenance.
Before the actual maintenance begins, I would like to modify the login page so that new users cannot log in.
For example, I would like to display a message such as:
“Scheduled maintenance will begin in 9 hours.”
At the same time, I would like users who are already logged in to continue using their existing notebook servers without interruption.
We are exposing JupyterHub through the proxy-public LoadBalancer service and are not using an Ingress controller.
What I have tried
I found that I can disable the login button by overriding the login template as shown below.
Although users can still log in by directly accessing the authentication URL, I believe very few users would do that,
so simply disabling the login button is sufficient for our use case.
I apply the configuration using:
helm upgrade \
--install jhub jupyterhub/jupyterhub \
--namespace jhub \
--create-namespace \
--values config.yaml \
--timeout 20m
Questions
- Is there a better or more standard way to implement a temporary maintenance mode in Zero to JupyterHub?
- Updating the login template requires running helm upgrade, which causes the Hub pod to restart. Is there any way to temporarily change the login page without restarting the Hub pod?
Environment
- CHART VERSION: 4.4.0
- App Version: 5.5.0
Configuration
hub:
extraFiles:
login-template:
mountPath: /usr/local/share/jupyterhub/custom_templates/login.html
stringData: |
{% extends "page.html" %}
{% if announcement_login is string %}
{% set announcement = announcement_login %}
{% endif %}
{% block login_widget %}
{% endblock login_widget %}
{% block main %}
<div id="login-main" class="container">
<div class="service-login">
<h1>Maintenance</h1>
<p>JupyterHub is currently under maintenance.</p>
<p>New logins are temporarily disabled. Please try again later.</p>
<button role="button"
class="btn btn-jupyter btn-lg"
disabled>
Sign in with {{ login_service }}
</button>
</div>
</div>
{% endblock main %}
extraConfig:
# Maintenance
templates: |
c.JupyterHub.template_paths = ["/usr/local/share/jupyterhub/custom_templates"]
proxy:
https:
enabled: true
type: manual
manual:
cert:
key:
Best regards,