首页 > 解决方案 > 尝试在 Kubernetes 上实现 Jupyterhub

问题描述

我正在尝试在我学校的一组 8 台完全相同的非集群计算机上实现 Jupyterhub。我的指示是首先对 8 个系统(均运行 Ubuntu 18.04 LTS)进行集群,并在该集群上实现 Jupyterhub。

在网上搜索后,这些是我遵循的说明-

  1. 使用此说明在两个系统上安装了 docker
  2. (已尝试)使用此说明实现了 Kubernetes 集群
  3. 使用从零到 jupyterhub 的指令实现 Jupyterhub

使用说明,我已经设法完成了第 1 步和第 2 步。但是在使用从零到jupyterhub的说明安装helm后,我在执行此网页中安装Jupyterhub部分的第2步时遇到了错误。

我的确切错误是:

Error: Get https://10.96.0.1:443/api/v1/namespaces/kube-system/configmaps?labelSelector=NAME%D(MISSING)jhub%!(MISSING)OWNER%D(MISSING)TILLER%!D(MISSING)DEPLOYED: dial tcp 10.96.0.1:443: i/o timeout
Error: UPGRADE FAILED : Get https://10.96.0.1:443/api/v1/namespaces/kube-system/configmaps?labelSelector=NAME%D(MISSING)jhub%!(MISSING)OWNER%D(MISSING)TILLER%!D(MISSING)DEPLOYED: dial tcp 10.96.0.1:443: i/o timeout

然后当我查看链接时,我得到了这个:[ https://10.96.0.1:443/api/v1/namespaces/...]

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  },
  "status": "Failure",
  "message": "configmaps is forbidden: User \"system:anonymous\" cannot list resource \"configmaps\" in API group \"\" in the namespace \"kube-system\"",
  "reason": "Forbidden",
  "details": {
    "kind": "configmaps"
  },
  "code": 403
}

有没有人遇到过这个问题?你做了什么?谢谢任何愿意回答的人...

另外,请随时告诉我我在实施中错了,因为我对新想法持开放态度。如果您有任何更好的方法,请留下有关如何实施它的说明。非常感谢。

标签: dockerkubernetesjupyterhubkubernetes-helm

解决方案


当我升级我的 minikube 时,我遇到了完全相同的问题。在我的情况下,我不得不删除集群并重新启动它——从那里一切正常。

在您的情况下,来自 Tiller 的请求似乎被阻止并且无法访问 API。如果是新集群,我认为问题可能是 CNI 配置不正确,但要确认您必须添加有关您使用的 CNI 以及是否使用--pod-network-cidr=标志或任何其他可能导致冲突或阻塞的步骤的信息Tiller 请求。

在添加该信息之前,我只能建议运行:

kubeadm reset

假设您想使用 Calico:

kubeadm init --pod-network-cidr=192.168.0.0/16

kubectl apply -f https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
kubectl apply -f https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml`

安装头盔:

curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > get_helm.sh
chmod 700 get_helm.sh
./get_helm.sh
kubectl create serviceaccount tiller --namespace kube-system
kubectl create clusterrolebinding tiller-cluster-rule \
 --clusterrole=cluster-admin \
 --serviceaccount=kube-system:tiller
helm init --service-account=tiller

现在按照 Jupyter Hub 教程:按照此处config.yaml所述创建。并安装 JupyterHub:

helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
helm repo update
RELEASE=jhub
NAMESPACE=jhub

helm upgrade --install $RELEASE jupyterhub/jupyterhub \
  --namespace $NAMESPACE  \
  --version=0.8.0 \
  --values config.yaml

推荐阅读