试图在Kubernetes上实现Jupyterhub

问题描述 投票:0回答:2

我试图在我学校的一套8台非集群完全相同的计算机上实现Jupyterhub。我的指示是首先集群8个系统(所有运行Ubuntu 18.04 LTS)并在该集群上实现Jupyterhub。

搜索网后,这些是我遵循的指示 -

  1. 使用此instructions在两个系统上安装了docker
  2. (尝试)使用这个instructionsthis实现了Kubernetes集群
  3. 使用zero-to-jupyterhub instructions实现Jupyterhub

使用我已设法完成步骤1和2的说明。但是在使用zero-to-jupyterhub的指令安装helm后,我在执行此webpage中安装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
}

有谁遇到过这个问题?你做了什么?谢谢你的回答...

此外,随时可以告诉我,我对实施有误,因为我对新想法持开放态度。如果您有更好的方法,请留下如何实施它的说明。非常感谢你。

docker kubernetes jupyterhub kubernetes-helm
2个回答
0
投票

您似乎已启用RBAC并且正在尝试访问不允许从您的帐户访问的资源。

您是否按照说明设置了Helm / Tiller?应该有两个命令可以创建部署JupyterHub的适当权限:

kubectl --namespace kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller

希望这可以帮助!


0
投票

当我升级我的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创建here。并安装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
© www.soinside.com 2019 - 2024. All rights reserved.