关于kubernetes:Kubernetesk8s集群安装JupyterHub以及Lab

5次阅读

共计 3492 个字符,预计需要花费 9 分钟才能阅读完成。

背景

JupyterHub 为用户组带来了笔记本的弱小性能。它使用户可能拜访计算环境和资源,而不会给用户带来装置和保护工作的累赘。用户——包含学生、钻研人员和数据科学家——能够在他们本人的工作空间中实现他们的工作,共享资源能够由系统管理员无效治理。

JupyterHub 在云端或您本人的硬件上运行,能够为世界上的任何用户提供事后配置的数据迷信环境。它是可定制和可扩大的,实用于小型和大型团队、学术课程和大型基础设施。

第一步 、参考:https://cloud.tencent.com/dev… 创立动静挂载存储

第二步 、装置 helm

root@hello:~# curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
root@hello:~# sudo apt-get install apt-transport-https --yes
root@hello:~# echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
root@hello:~# sudo apt-get update
root@hello:~# sudo apt-get install helm

第三步 、导入镜像

root@hello:~# docker load -i pause-3.5.tar
root@hello:~# docker load -i kube-scheduler.tar

第四步 、装置 jupyterhub

helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/


helm repo update


helm upgrade --cleanup-on-fail \
  --install ju jupyterhub/jupyterhub \
  --namespace ju \
  --create-namespace \
  --version=1.2.0 \
  --values config.yaml

注:此文件能够自定义内容,具体看正文,如下开启 lab 性能

root@hello:~# vim config.yaml
root@hello:~# cat config.yaml 
# This file can update the JupyterHub Helm chart's default configuration values.
# #
# # For reference see the configuration reference and default values, but make
# # sure to refer to the Helm chart version of interest to you!
# #
# # Introduction to YAML:     https://www.youtube.com/watch?v=cdLNKUoMc6c
# # Chart config reference:   https://zero-to-jupyterhub.readthedocs.io/en/stable/resources/reference.html
# # Chart default values:     https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/HEAD/jupyterhub/values.yaml
# # Available chart versions: https://jupyterhub.github.io/helm-chart/
# #
singleuser:
  defaultUrl: "/lab"
  extraEnv:
    JUPYTERHUB_SINGLEUSER_APP: "jupyter_server.serverapp.ServerApp"

#singleuser:
#  defaultUrl: "/lab"
#  extraEnv:
#    JUPYTERHUB_SINGLEUSER_APP: "notebook.notebookapp.NotebookApp"
root@hello:~# 
root@hello:~# 
root@hello:~#

第五步、批改 svc 为 nodeport

root@hello:~# kubectl get svc  -A
NAMESPACE     NAME                        TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                  AGE
default       kubernetes                  ClusterIP      10.68.0.1       <none>        443/TCP                  16h
ju            hub                         ClusterIP      10.68.60.16     <none>        8081/TCP                 114s
ju            proxy-api                   ClusterIP      10.68.239.54    <none>        8001/TCP                 114s
ju            proxy-public                LoadBalancer   10.68.62.47     <pending>     80:32070/TCP             114s
kube-system   dashboard-metrics-scraper   ClusterIP      10.68.244.241   <none>        8000/TCP                 16h
kube-system   kube-dns                    ClusterIP      10.68.0.2       <none>        53/UDP,53/TCP,9153/TCP   16h
kube-system   kube-dns-upstream           ClusterIP      10.68.221.104   <none>        53/UDP,53/TCP            16h
kube-system   kubernetes-dashboard        NodePort       10.68.206.196   <none>        443:32143/TCP            16h
kube-system   metrics-server              ClusterIP      10.68.1.149     <none>        443/TCP                  16h
kube-system   node-local-dns              ClusterIP      None            <none>        9253/TCP                 16h
root@hello:~# kubectl edit svc proxy-public -n ju
service/proxy-public edited
root@hello:~# 
root@hello:~# 
root@hello:~# kubectl get svc  -A
NAMESPACE     NAME                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                  AGE
default       kubernetes                  ClusterIP   10.68.0.1       <none>        443/TCP                  16h
ju            hub                         ClusterIP   10.68.60.16     <none>        8081/TCP                 2m19s
ju            proxy-api                   ClusterIP   10.68.239.54    <none>        8001/TCP                 2m19s
ju            proxy-public                NodePort    10.68.62.47     <none>        80:32070/TCP             2m19s
kube-system   dashboard-metrics-scraper   ClusterIP   10.68.244.241   <none>        8000/TCP                 16h
kube-system   kube-dns                    ClusterIP   10.68.0.2       <none>        53/UDP,53/TCP,9153/TCP   16h
kube-system   kube-dns-upstream           ClusterIP   10.68.221.104   <none>        53/UDP,53/TCP            16h
kube-system   kubernetes-dashboard        NodePort    10.68.206.196   <none>        443:32143/TCP            16h
kube-system   metrics-server              ClusterIP   10.68.1.149     <none>        443/TCP                  16h
kube-system   node-local-dns              ClusterIP   None            <none>        9253/TCP                 16h
root@hello:~#

https://blog.csdn.net/qq_3392…

https://my.oschina.net/u/3981543

https://www.zhihu.com/people/…

https://segmentfault.com/u/hp…

https://juejin.cn/user/331578…

https://space.bilibili.com/35…

https://cloud.tencent.com/dev…

知乎、CSDN、开源中国、思否、掘金、哔哩哔哩、腾讯云

本文应用 文章同步助手 同步

正文完
 0