Jupyterhub K8s-将用户从Jovyan更改为NB_USER的问题

时间:2019-09-13 10:05:38

标签: jupyter-notebook jupyter jupyterhub

Everything works well until we wanted to set the NB_USER to the logged in user. When changed the config to run as root and start.sh as default cmd, getting the below error in the log and the container is failing to start. Any help is highly appreciated

以超级用户身份运行容器后,获取以下错误日志:
将用户名设置为:user1 将主目录重定位到/ home / user1 mv:无法将'/ home / jovyan'移至'/ home / user1':设备或资源繁忙

Here is the config.yaml
singleuser:
defaultUrl: "/lab"
uid: 0
fsGid: 0
hub:
extraConfig: |
c.KubeSpawner.args = ['--allow-root']
c.Spawner.cmd = ['start.sh','jupyterhub-singleuser']
def notebook_dir_hook(spawner):
spawner.environment = {'NB_USER':spawner.user.name, 'NB_UID':'1500'}
c.Spawner.pre_spawn_hook = notebook_dir_hook
from kubernetes import client
def modify_pod_hook(spawner, pod):
pod.spec.containers[0].security_context = client.V1SecurityContext(
privileged=True,
capabilities=client.V1Capabilities(
add=['SYS_ADMIN']
)
)`enter code here`
return pod
c.KubeSpawner.modify_pod_hook = modify_pod_hook

0 个答案:

没有答案