本文介绍了部署jupyterhub时​​无法从config.yaml运行生命周期命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Pod创建并开始运行后立即运行命令.我正在部署jupyterhub,但是我正在使用的配置是:

I want to run a command as soon as a pod is created and starts running. I am deploying jupyterhub but the config that I am using is:

proxy:
  secretToken: "yada yada"
singleuser:
  image:
    # Get the latest image tag at:
    # https://hub.docker.com/r/jupyter/datascience-notebook/tags/
    # Inspect the Dockerfile at:
    # https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook/Dockerfile
    name: jupyter/datascience-notebook
    # name: ${IMAGE}
    tag: 177037d09156
    # tag: latest
  lifecycle:
    postStart:
      exec:
        command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]

当Pod启动并运行时,我看不到文件/usr/share/message,因此推断出exec命令未运行.

When the pod is up and running, I am not able to see the file /usr/share/message and hence, I deduce that the exec command is not running.

使此命令起作用的正确方法是什么?

What is the right way to make this command work?

推荐答案

生命周期节的正确密钥是 lifecyleHooks .

以下blob具有正确的值.

Following blob is with the correct values.

proxy:
  secretToken: "yada yada"
singleuser:
  image:
    # Get the latest image tag at:
    # https://hub.docker.com/r/jupyter/datascience-notebook/tags/
    # Inspect the Dockerfile at:
    # https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook/Dockerfile
    name: jupyter/datascience-notebook
    # name: ${IMAGE}
    tag: 177037d09156
    # tag: latest
  lifecycleHooks:
    postStart:
      exec:
        command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]

这篇关于部署jupyterhub时​​无法从config.yaml运行生命周期命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 15:17