Docker-stacks: Login to Notebook after Kubernetes Deployment

Created on 21 Nov 2017  路  4Comments  路  Source: jupyter/docker-stacks

Example: jupyter/base

I created a simple yaml file to deploy jupyter/base using Kubernetes.
I port forwarded port 8888 to 8888 on my local machine from the command line.
When browsing to the container, I am stuck at a login screen.

Unlike docker, starting the container never provided a url with a token to login. is there a solution to this? is there something i can include in the yml file to bypass or automate the login process?

sample yaml:
apiVersion: v1
kind: Pod
metadata:
name: ml2test
spec:
containers:
- image: jupyter/base-notebook
name: jtftest
ports:
- containerPort: 8888
protocol: TCP

Question

All 4 comments

I think you'll need to pre-generate a hashed password and pass it as a command line parameter instead of relying on Notebook to generate a random password for you. Look for NotebookApp.password on http://jupyter-notebook.readthedocs.io/en/stable/config.html about how to generate the password and the command line argument to use to pass it to the notebook server when you start the container. (--NotebookApp.password=<the generated value>)

A more robust solution probably requires running JupyterHub under Kubernetes hooked to an auth system. This guide (https://zero-to-jupyterhub.readthedocs.io/en/v0.4-doc/) can help you take that next step when you're ready.

      - image: jupyter/tensorflow-notebook
        command: ["start-notebook.sh"]
        args: ["--NotebookApp.password='sha1:a83ae395cdfe:5e480cc11a05a594f59cc8b8ee8e41200c1a7866'"]

this question looks resolved 馃憤

Agreed. @iramsey85 feel free to comment back or reopen if you're still having trouble.

Was this page helpful?
0 / 5 - 0 ratings