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

<pre><code>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 &gt; /usr/share/message"]
</code></pre>

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

<p>What is the right way to make this command work?</p>

<p>The correct key for <strong>lifecycle</strong> stanza is <strong>lifecyleHooks</strong>.</p>

<p>Following blob is with the correct values. </p>

<pre><code>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 &gt; /usr/share/message"]
</code></pre>
