# Hook-image-puller not use the specific mirror

**URL:** <https://discourse.jupyter.org/t/hook-image-puller-not-use-the-specific-mirror/29324>\
**Category:** Zero to JupyterHub on Kubernetes\
**Tags:** help-wanted\
**Created:** [October 17, 2024, 3:55pm UTC](https://discourse.jupyter.org/t/hook-image-puller-not-use-the-specific-mirror/29324 "2024-10-17T15:55:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![irorange27](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/irorange27/32/15461_2.png) [@irorange27](https://discourse.jupyter.org/u/irorange27)\
**Post date:** [October 17, 2024, 3:55pm UTC](https://discourse.jupyter.org/t/hook-image-puller-not-use-the-specific-mirror/29324/1 "2024-10-17T15:55:59Z")

</div>

I tried to initialize my jupyterhub with k8s at the basis of _z2jh_.

Before I used it as above, I changed all _[registry.k8s.io](http://registry.k8s.io)_ to _[m.daocloud.io/registry.k8s.io](http://m.daocloud.io/registry.k8s.io)_

```auto
helm upgrade jhub jupyterhub/ --values=config.yaml

```

config.yaml

```auto
singleuser:
  networkPolicy:
    enabled: false
  defaultUrl: "/lab"
  extraEnv:
    EDITOR: "vim"
    SHELL: "/bin/zsh"
  startTimeout: 300
  storage:
    capacity: 2Gi
    dynamic:
      storageClass: nfs-csi
    extraVolumes:
      - name: shm-volume
        mountPath: /dev/shm
        emptyDir:
          medium: Memory
          sizeLimit: "2Gi"
  image:
    # You should replace the "latest" tag with a fixed version from:
    # https://hub.docker.com/r/jupyter/datascience-notebook/tags/
    # Inspect the Dockerfile at:
    # https://github.com/jupyter/docker-stacks/tree/HEAD/datascience-notebook/Dockerfile
    name: hub.dlcloud.info/blcc/base-notebook
    tag: v1
    pullPolicy: Never
  # `cmd: null` allows the custom CMD of the Jupyter docker-stacks to be used
  # which performs further customization on startup.
  cmd: null

```

```auto
kubectl get pods
# then get
NAME READY STATUS RESTARTS AGE
continuous-image-puller-nqw5s 1/1 Running 0 94m
hook-image-puller-4fkx6 0/1 ImagePullBackOff 0 47m
hub-7b8486d6c9-mfvcb 0/1 Pending 0 80m
proxy-64dcf6c4f6-d7htm 1/1 Running 0 94m
user-scheduler-7955497f75-6fr9p 1/1 Running 0 94m
user-scheduler-7955497f75-7gsqk 1/1 Running 0 94m

```

```auto
kubectl describe pods hook-image-puller-...

  Normal Pulling 42m (x4 over 48m) kubelet Pulling image "registry.k8s.io/pause:3.9"
  Warning Failed 40m (x4 over 47m) kubelet Error: ErrImagePull
  Warning Failed 40m (x4 over 44m) kubelet Error: ImagePullBackOff

```

I expected to pull from my mirror website, but it still pulled from registry.k8s. At the same time, I have downloaded the images and taged the same name, strangely not use it but repulled it.

---

<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:** [October 17, 2024, 4:40pm UTC](https://discourse.jupyter.org/t/hook-image-puller-not-use-the-specific-mirror/29324/2 "2024-10-17T16:40:05Z")

</div>

Please could you share your full Z2JH config with us (apart from secrets), and tell us which version of Z2JH you’re using?

---

<div class="post-metadata">

**Author:** ![irorange27](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/irorange27/32/15461_2.png) [@irorange27](https://discourse.jupyter.org/u/irorange27)\
**Post date:** [October 18, 2024, 3:51am UTC](https://discourse.jupyter.org/t/hook-image-puller-not-use-the-specific-mirror/29324/3 "2024-10-18T03:51:32Z")

</div>

Thank you for offering to help! Here’s the information you need:

I used the Z2JH version is `v3.3.8`。

And my full _config.yaml_ removed secret and OAuth here .

```yaml
proxy:
  chp:
    networkPolicy:
      enabled: false
  service:
    nodePorts:
      http: 30000

debug:
  enabled: true

hub:
  networkPolicy:
    enabled: false
      # extraVolumes:
      # - name: hub-db-dir
      # persistentVolumeClaim:
      # claimName: hub-db-dir
  config:
    admin_users:
      - jianghy
      - zhonger
    JupyerHub:
      authenticator_class: gitlab # oauthenticator.gitlab.GitLabOAuthenticator
    GitLabAuthenticator:
        # some config there ...

cull:
  enabled: true
  maxAge: 172800
  timeout: 600
  every: 60

singleuser:
  networkPolicy:
    enabled: false
  defaultUrl: "/lab"
  extraEnv:
    EDITOR: "vim"
    SHELL: "/bin/zsh"
  startTimeout: 300
  storage:
    capacity: 2Gi
    dynamic:
      storageClass: nfs-csi
    extraVolumes:
      - name: shm-volume
        mountPath: /dev/shm
        emptyDir:  
          medium: Memory
          sizeLimit: "2Gi"
  image:
    name: hub.dlcloud.info/blcc/base-notebook
    tag: v1
    pullPolicy: Never
  cmd: null

```

---

<div class="post-metadata">

**Author:** ![consideRatio](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/consideratio/32/1033_2.png) [@consideRatio](https://discourse.jupyter.org/u/consideRatio)\
**Post date:** [October 18, 2024, 5:13am UTC](https://discourse.jupyter.org/t/hook-image-puller-not-use-the-specific-mirror/29324/4 "2024-10-18T05:13:58Z")

</div>

Look at the chart’s default values, you will find the image [registry.k8s.io/pause](http://registry.k8s.io/pause) be referenced someplace. Configure to use your own image there.

> <https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/470a027a553d102b00295792dd0c07039b409ae5/jupyterhub/values.yaml#L686>

---

<div class="post-metadata">

**Author:** ![irorange27](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/irorange27/32/15461_2.png) [@irorange27](https://discourse.jupyter.org/u/irorange27)\
**Post date:** [October 18, 2024, 5:42am UTC](https://discourse.jupyter.org/t/hook-image-puller-not-use-the-specific-mirror/29324/5 "2024-10-18T05:42:43Z")

</div>

I changed default values.yaml with vim instruction _:%s/m.daocloud.io/registry.k8s/registry.k8s/g_ and reinstalled it but not worked.

```yaml
  pause:
    containerSecurityContext:
      runAsUser: 65534 # nobody user
      runAsGroup: 65534 # nobody group
      allowPrivilegeEscalation: false
    image:
      name: m.daocloud.io/registry.k8s.io/pause
      # tag is automatically bumped to new patch versions by the
      # watch-dependencies.yaml workflow.
      #
      # If you update this, also update scheduling.userPlaceholder.image.tag
      #
      tag: "3.9"
      pullPolicy: Never
      pullSecrets: []

```

_hook-image-puller-_\* still try to pull _[registry.k8s.io/pause](http://registry.k8s.io/pause)_ rather than my own configuration.

And I found a strange thing is I changed my base-notebook version from v1 to v2 (config.yaml) , but still pulled v1 rather than v2.

---

<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:** [October 18, 2024, 2:38pm UTC](https://discourse.jupyter.org/t/hook-image-puller-not-use-the-specific-mirror/29324/6 "2024-10-18T14:38:55Z")

</div>

It sounds like your changes weren’t deployed. What command are you running? If you delete your deployment, check that everything is deleted, and redeploy, does it work?

---

<div class="post-metadata">

**Author:** ![irorange27](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/irorange27/32/15461_2.png) [@irorange27](https://discourse.jupyter.org/u/irorange27)\
**Post date:** [October 19, 2024, 4:51am UTC](https://discourse.jupyter.org/t/hook-image-puller-not-use-the-specific-mirror/29324/7 "2024-10-19T04:51:57Z")

</div>

Directory as follow:

```auto
.
├── config.yaml
├── jupyterhub # z2jh chart pulled

```

Command is **helm upgrade --install jhub jupyterhub/ --values=config.yaml**
