Commit 92fe05d1 authored by Min RK's avatar Min RK Committed by GitHub

Merge pull request #558 from jupyter-on-openshift/home-volume-mounting

Avoid placing anything under home directory in OpenShift deployments.
parents a7b1f810 4d2992bc
...@@ -133,11 +133,9 @@ You can upload notebooks and other files using the web interface of the notebook ...@@ -133,11 +133,9 @@ You can upload notebooks and other files using the web interface of the notebook
oc set volume dc/mynotebook --add \ oc set volume dc/mynotebook --add \
--type=pvc --claim-size=1Gi --claim-mode=ReadWriteOnce \ --type=pvc --claim-size=1Gi --claim-mode=ReadWriteOnce \
--claim-name mynotebook-data --name data \ --claim-name mynotebook-data --name data \
--mount-path /home/jovyan/work --mount-path /home/jovyan
``` ```
When you upload any notebooks or data files, place them under the ``work`` directory.
When you have deleted the notebook instance, if using a persistent volume, you will need to delete it in a separate step. When you have deleted the notebook instance, if using a persistent volume, you will need to delete it in a separate step.
``` ```
...@@ -158,7 +156,7 @@ The ``data`` field of the config map contains Python code used as the ``jupyter_ ...@@ -158,7 +156,7 @@ The ``data`` field of the config map contains Python code used as the ``jupyter_
If you are using a persistent volume, you can also create a configuration file at: If you are using a persistent volume, you can also create a configuration file at:
``` ```
/home/jovyan/work/.jupyter/jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py
``` ```
This will be merged at the end of the configuration from the config map. This will be merged at the end of the configuration from the config map.
...@@ -207,7 +205,7 @@ This will trigger a new deployment so ensure you have downloaded any work if not ...@@ -207,7 +205,7 @@ This will trigger a new deployment so ensure you have downloaded any work if not
If using a persistent volume, you could instead setup a password in the file: If using a persistent volume, you could instead setup a password in the file:
``` ```
/home/jovyan/work/.jupyter/jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py
``` ```
as per guidelines in: as per guidelines in:
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
} }
}, },
"data": { "data": {
"jupyter_notebook_config.py": "import os\n\npassword = os.environ.get('JUPYTER_NOTEBOOK_PASSWORD')\n\nif password:\n import notebook.auth\n c.NotebookApp.password = notebook.auth.passwd(password)\n del password\n del os.environ['JUPYTER_NOTEBOOK_PASSWORD']\n\nimage_config_file = '/home/jovyan/work/.jupyter/jupyter_notebook_config.py'\n\nif os.path.exists(image_config_file):\n with open(image_config_file) as fp:\n exec(compile(fp.read(), image_config_file, 'exec'), globals())\n" "jupyter_notebook_config.py": "import os\n\npassword = os.environ.get('JUPYTER_NOTEBOOK_PASSWORD')\n\nif password:\n import notebook.auth\n c.NotebookApp.password = notebook.auth.passwd(password)\n del password\n del os.environ['JUPYTER_NOTEBOOK_PASSWORD']\n\nimage_config_file = '/home/jovyan/.jupyter/jupyter_notebook_config.py'\n\nif os.path.exists(image_config_file):\n with open(image_config_file) as fp:\n exec(compile(fp.read(), image_config_file, 'exec'), globals())\n"
} }
}, },
{ {
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
"image": "${NOTEBOOK_IMAGE}", "image": "${NOTEBOOK_IMAGE}",
"command": [ "command": [
"start-notebook.sh", "start-notebook.sh",
"--config=/home/jovyan/configs/jupyter_notebook_config.py", "--config=/etc/jupyter/openshift/jupyter_notebook_config.py",
"--no-browser", "--no-browser",
"--ip=0.0.0.0" "--ip=0.0.0.0"
], ],
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
], ],
"volumeMounts": [ "volumeMounts": [
{ {
"mountPath": "/home/jovyan/configs", "mountPath": "/etc/jupyter/openshift",
"name": "configs" "name": "configs"
} }
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment