0

I would like to configure the password to my Jupyter notebook in the deployment.yaml file. I run this file with kubectl. The notebook starts up fine, but the password is not set. How can I improve the yaml file to configure a password?

apiVersion: apps/v1
kind: Deployment
metadata:
  name: minimal-notebook
  labels:
    app: minimal-notebook
spec:
  replicas: 1
  selector:
    matchLabels:
      app: minimal-notebook
  template:
    metadata:
      labels:
        app: minimal-notebook
    spec:
      containers:
      - name: minimal-notebook
        image: jupyter/minimal-notebook:latest
        ports:
        - containerPort: 8888
        args: ["start-notebook.sh", "--NotebookApp.password='sha1:[password]'"]
ktm5124
  • 11,861
  • 21
  • 74
  • 119

1 Answers1

1

In the space “[password]” on your code, you need to enter a hashed password to use for web authentication, you can prepare a hashed password manually, using the function “from notebook.auth import passwd; passwd()” in a python/IPython shell; you can use the next links as a guide to prepare the hashed password link 1 link 2 where is the next example:

from notebook.auth import passwd
passwd()
Enter password:
Verify password:
Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'

If you prefer you can also use an algorithm using the next links link 3 link 4

joserobertog
  • 109
  • 4