如何使jupyter-hub访问我的私有docker映像存储库? [英] How do I make jupyter-hub access my private docker image repository?

查看:228
本文介绍了如何使jupyter-hub访问我的私有docker映像存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在JuPyter-hub上部署我自己的映像.但是,我需要将其部署到某个注册表中,以便JHub的image puller可以从那里拉出它.就我而言,注册表是私有的.尽管我可以将映像推送到注册表,但我不知道如何使jupyterhub发行和部署能够提取映像.

I want to deploy my own image on JuPyter-hub. However, I need to deploy it to some registry so that the image puller 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.

我尝试阅读此文档( https://github.com/jupyterhub/jupyterhub-deploy -docker ),但无法帮助我理解如何在jupyter hub部署中添加身份验证.

I tried reading this doc (https://github.com/jupyterhub/jupyterhub-deploy-docker) but it could not help me understand how am I to add authentication in the jupyter hub deployment.

我使用以下命令部署jhub:

#  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

其中jupyter-hub-config.yaml如下:

where the jupyter-hub-config.yaml is as follows:

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" ''> aviral.py']

可在此处查看舵图: https://jupyterhub. github.io/helm-chart/jupyterhub-0.8.2.tgz

这个掌舵图的树是:

.
├── 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

我要做的就是使用secrets使jupyterhub访问我的私人仓库.在这种情况下,我不知道如何使它可用.

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

推荐答案

图片提取秘密可用于从私有注册表中提取图片.

Image pull secret can be used to pull a image from private registry.

在jupyter-hub-config.yam后面加上以下blob.

Append the jupyter-hub-config.yam with the following blob.

imagePullSecret:
    enabled: true
    registry:
    username:
    email:
    password:

具有价值

用户名:AWS

密码:aws ecr get-login --region ${REGION} --registry-ids ${ACCOUNT} | cut -d' ' -f6

这篇关于如何使jupyter-hub访问我的私有docker映像存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆