from notebook.auth import passwd
해당 모듈 import 시 설치가 되어 있지 않다고 나올 경우
(base) root@jupyterlab-deployment-96d5cd489-kjrd4:~# jupyter notebook --generate-config
Writing default config to: /home/jovyan/.jupyter/jupyter_notebook_config.py
!pip3 install notebook==6.5.5
이렇게 해서 해결이 안되면
!pip3 install --upgrade ipython
요렇게 도 해본다
다시
from notebook.auth import passwd
# 아래 전체가 암호이다
'argon2:$argon2id$v=19$m=10240,t=10,p=8$QbPT9aYvhdqRFecguJX5sg$ArunzaJ65DCEA6MnCL7N9Y2m0Y1XwVCR3N95PC3lGxE'
(base) root@jupyterlab-deployment-96d5cd489-kjrd4:~/.jupyter# vi jupyter_notebook_config.py
없으면 추가
c.ServerApp.password_required = True
c.PasswordIdentityProvider.hashed_password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$QbPT9aYvhdqRFecguJX5sg$ArunzaJ65DCEA6MnCL7N9Y2m0Y1XwVCR3N95PC3lGxE'
deply.yaml 에서
chmod -R 777 /home/jovyan/work
start.sh jupyter lab --LabApp.token='password' --LabApp.ip='0.0.0.0' --LabApp.allow_root=True
해당 부분을
start.sh jupyter lab --LabApp.token='' --LabApp.password=''
이렇게 변경
해당 부분을
apiVersion: apps/v1
kind: Deployment
metadata:
name: jupyterlab-deployment
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: jupyterlab
template:
metadata:
labels:
app: jupyterlab
spec:
securityContext:
runAsUser: 0
fsGroup: 0
containers:
- name: jupyterlab
image: jupyter/datascience-notebook:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8888
command:
- /bin/bash
- -c
- |
chmod -R 777 /home/jovyan/work
start.sh jupyter lab --LabApp.token='' --LabApp.password='' --LabApp.ip='0.0.0.0' --LabApp.allow_root=True
#start.sh jupyter lab --LabApp.token='password' --LabApp.ip='0.0.0.0' --LabApp.allow_root=True
volumeMounts:
- name: jupyterlab-data
mountPath: /home/jovyan/work
#mountPath: /data
- name: jupyterlab-config
mountPath: /home/jovyan/.jupyter
securityContext:
runAsUser: 0
resources:
requests:
memory: 500Mi
cpu: 250m
restartPolicy: Always
volumes:
- name: jupyterlab-data
#persistentVolumeClaim:
#claimName: fileshare-pvc
hostPath:
path: /home/sysic/Data
- name: jupyterlab-config
hostPath:
path: /home/sysic/config
################### 홈 디렉토리 변경하기 #########################################
(base) root@jupyterlab-deployment-6886db8858-rf68k:~/.jupyter# pwd
/home/jovyan/.jupyter
(base) root@jupyterlab-deployment-6886db8858-rf68k:~/.jupyter# more jupyter_notebook_config.py |grep jaeyon
c.ServerApp.root_dir = '/home/jaeyong'
(base) root@jupyterlab-deployment-6886db8858-rf68k:~/.jupyter#
apiVersion: apps/v1
kind: Deployment
metadata:
name: jupyterlab-deployment
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: jupyterlab
template:
metadata:
labels:
app: jupyterlab
spec:
securityContext:
runAsUser: 0
fsGroup: 0
containers:
- name: jupyterlab
image: jupyter/datascience-notebook:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8888
command:
- /bin/bash
- -c
- |
chmod -R 777 /home/jaeyong
#chmod -R 777 /home/jovyan/work
start.sh jupyter lab --LabApp.token='' --LabApp.password='' --LabApp.ip='0.0.0.0' --LabApp.allow_root=True
#start.sh jupyter lab --LabApp.token='password' --LabApp.ip='0.0.0.0' --LabApp.allow_root=True
volumeMounts:
- name: jupyterlab-data
mountPath: /home/jaeyong
#mountPath: /home/jovyan/work
#mountPath: /data
- name: jupyterlab-config
mountPath: /home/jovyan/.jupyter
securityContext:
runAsUser: 0
resources:
requests:
memory: 500Mi
cpu: 250m
restartPolicy: Always
volumes:
- name: jupyterlab-data
#persistentVolumeClaim:
#claimName: fileshare-pvc
hostPath:
path: /home/sysic/Data
- name: jupyterlab-config
hostPath:
path: /home/sysic/config
'나는 노동자 > KUBERNETES' 카테고리의 다른 글
GRAFANA Time Range(V9.3.6 UP) (0) | 2023.02.24 |
---|---|
인증서 기간 연장하기 (0) | 2021.11.25 |
인증서 갱신 - 전통적인 방법 (0) | 2021.11.24 |
kubelet.conf certification 기간 확인 (0) | 2021.11.24 |
계속 꺼지는 etcd 컨테이너 etcd 용량 줄이기 (0) | 2021.11.21 |