<p>I want to deploy my own image on JuPyter-hub. However, I need to deploy it to some registry so that the <code>image puller</code> of JHub can pull it from there. In my case, the registry is private. Although I am able to push the image to my registry, I don't know how will I make the jupyterhub release and deployment be able to pull the image.</p>

<p>I tried reading this doc (<a href="https://github.com/jupyterhub/jupyterhub-deploy-docker" rel="nofollow noreferrer">https://github.com/jupyterhub/jupyterhub-deploy-docker</a>) but it could not help me understand how am I to add authentication in the jupyter hub deployment.</p>

<p>I deploy <code>jhub</code> with this command:</p>

<pre><code>#  Suggested values: advanced users of Kubernetes and Helm should feel
# free to use different values.
RELEASE=jhub
NAMESPACE=jhub

helm upgrade --install $RELEASE jupyterhub/jupyterhub \
  --namespace $NAMESPACE  \
  --version=0.8.0 \
  --values jupyter-hub-config.yaml
</code></pre>

<p>where the jupyter-hub-config.yaml is as follows:</p>

<pre><code>proxy:
  secretToken: "abcd"
singleuser:
  image:
    name: jupyter/datascience-notebook
    tag: some_tag
  lifecycleHooks:
    postStart:
      exec:
        command: ["/bin/sh", "-c", 'ipython profile create; cd ~/.ipython/profile_default/startup; echo ''run_id = "sample" ''&gt; aviral.py']
</code></pre>

<p>The helm chart is available here: <a href="https://jupyterhub.github.io/helm-chart/jupyterhub-0.8.2.tgz" rel="nofollow noreferrer">https://jupyterhub.github.io/helm-chart/jupyterhub-0.8.2.tgz</a></p>

<p>And the tree of this helm chart is:</p>

<pre><code>.
├── Chart.yaml
├── jupyter-hub-config.yaml
├── requirements.lock
├── schema.yaml
├── templates
│   ├── NOTES.txt
│   ├── _helpers.tpl
│   ├── hub
│   │   ├── configmap.yaml
│   │   ├── deployment.yaml
│   │   ├── image-credentials-secret.yaml
│   │   ├── netpol.yaml
│   │   ├── pdb.yaml
│   │   ├── pvc.yaml
│   │   ├── rbac.yaml
│   │   ├── secret.yaml
│   │   └── service.yaml
│   ├── image-puller
│   │   ├── _daemonset-helper.yaml
│   │   ├── daemonset.yaml
│   │   ├── job.yaml
│   │   └── rbac.yaml
│   ├── ingress.yaml
│   ├── proxy
│   │   ├── autohttps
│   │   │   ├── _README.txt
│   │   │   ├── configmap-nginx.yaml
│   │   │   ├── deployment.yaml
│   │   │   ├── ingress-internal.yaml
│   │   │   ├── rbac.yaml
│   │   │   └── service.yaml
│   │   ├── deployment.yaml
│   │   ├── netpol.yaml
│   │   ├── pdb.yaml
│   │   ├── secret.yaml
│   │   └── service.yaml
│   ├── scheduling
│   │   ├── _scheduling-helpers.tpl
│   │   ├── priorityclass.yaml
│   │   ├── user-placeholder
│   │   │   ├── pdb.yaml
│   │   │   ├── priorityclass.yaml
│   │   │   └── statefulset.yaml
│   │   └── user-scheduler
│   │       ├── _helpers.tpl
│   │       ├── configmap.yaml
│   │       ├── deployment.yaml
│   │       ├── pdb.yaml
│   │       └── rbac.yaml
│   └── singleuser
│       ├── image-credentials-secret.yaml
│       └── netpol.yaml
├── test-99.py
├── validate.py
└── values.yaml
</code></pre>

<p>All I want to do is to make jupyterhub access my private repo using <code>secrets</code>. In this case, I do not know how to make this available to it.</p>

<p><a href="https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod" rel="nofollow noreferrer">Image pull secret</a> can be used to pull a image from private registry.</p>

<p>Append the jupyter-hub-config.yam with the following blob.</p>

<pre><code>imagePullSecret:
    enabled: true
    registry:
    username:
    email:
    password:
</code></pre>

<p>With the Value</p>

<p>username:AWS </p>

<p>password:<code>aws ecr get-login --region ${REGION} --registry-ids ${ACCOUNT} | cut -d' ' -f6</code></p>
