# Container home replaced

**URL:** <https://discourse.jupyter.org/t/container-home-replaced/7857>\
**Category:** Zero to JupyterHub on Kubernetes\
**Tags:** how-to\
**Created:** [February 8, 2021, 1:02pm UTC](https://discourse.jupyter.org/t/container-home-replaced/7857 "2021-02-08T13:02:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amulone](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@amulone](https://discourse.jupyter.org/u/amulone)\
**Post date:** [February 8, 2021, 1:02pm UTC](https://discourse.jupyter.org/t/container-home-replaced/7857/1 "2021-02-08T13:02:49Z")

</div>

Hi,  
I have installed jupyterhub on k8s, I have enable multicontainer for each user.  
I created a container with sparkmagic configured for my cluster but when I start the container the /home/jovan is replaced and I do not find the kernel and the configuration for spark cluster.  
How can I address this issue? Shall I define an external persistance volume?  
Thanks

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [February 8, 2021, 9:27pm UTC](https://discourse.jupyter.org/t/container-home-replaced/7857/2 "2021-02-08T21:27:52Z")

</div>

Hi! Can you show us your full Z2JH and any other Jupyter related configuration, with secrets redacted? It’ll also be helpful if you can give us some information about your Kubernetes cluster.

---

<div class="post-metadata">

**Author:** ![amulone](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@amulone](https://discourse.jupyter.org/u/amulone)\
**Post date:** [February 9, 2021, 2:45pm UTC](https://discourse.jupyter.org/t/container-home-replaced/7857/3 "2021-02-09T14:45:48Z")

</div>

Hi,  
I deployed with helm.  
The helm config.yaml is:

```
proxy:
  secretToken: "XXXX"
prePuller:
  hook:
    enabled: false
ingress:
  enabled: true
  hosts:
    - jhub.gstp.k8s.altecspace.it
singleuser:
  image:
    pullPolicy: "Always"
    pullSecrets:
      - "gitlab"
  profileList:
    - display_name: "Spark SMO Cluster"
      description: "Environment with access to Spark Cluster"
      kubespawner_override:
        image: gitlab.altecspace.it:4567/k8s/jupyterhub/sparkmagic-smo
    - display_name: "TensorFlow"
      description: "Environment with TernsorFlow libraries"
      kubespawner_override:
        image: jupyter/tensorflow-notebook:5cb007f03275
    - display_name: "SciPy"
      description: "Environment with Scipy libraries"
      kubespawner_override:
        image: jupyter/scipy-notebook:5cb007f03275
  storage:
    dynamic:
      storageClass: cephfs
  extraEnv:
    GRANT_SUDO: "yes"
    NOTEBOOK_ARGS: "--allow-root"
    CHOWN_HOME: "yes"
    CHOWN_HOME_OPTS: "-R"
  uid: 0
  cmd: start-singleuser.sh
hub:
  config:
  containerSecurityContext:
    runAsUser: 0
    runAsGroup: 0
    allowPrivilegeEscalation: true
  fsGid: 0
debug:
  enabled: true

```

K8S, v. 1.16.15, is deployed on 3 physical nodes.  
Thanks

---

<div class="post-metadata">

**Author:** ![amulone](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@amulone](https://discourse.jupyter.org/u/amulone)\
**Post date:** [February 9, 2021, 6:17pm UTC](https://discourse.jupyter.org/t/container-home-replaced/7857/4 "2021-02-09T18:17:17Z")

</div>

I tried with lifecyclehooks but seems does not work:

```
singleuser:
  image:
    pullPolicy: "Always"
    pullSecrets:
      - "gitlab"
  profileList:
    - display_name: "Spark SMO Cluster"
      description: "Environment with access to Spark Cluster"
      kubespawner_override:
        image: gitlab.altecspace.it:4567/k8s/jupyterhub/sparkmagic-smo:0.2
        lifecycleHooks:
          postStart:
            exec:
              command: ["sh","/tmp/config.sh"]

```

Anything I try to set in lifecycleHooks seems not working also a touch.

Thanks

---

<div class="post-metadata">

**Author:** ![amulone](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@amulone](https://discourse.jupyter.org/u/amulone)\
**Post date:** [February 18, 2021, 12:26pm UTC](https://discourse.jupyter.org/t/container-home-replaced/7857/5 "2021-02-18T12:26:41Z")

</div>

I changed lifecycleHooks to lifecycle\_hooks and I solved.  
Thanks
