【问题标题】:Setting different resources for multiple Jupyter Notebook pods为多个 Jupyter Notebook pod 设置不同的资源
【发布时间】:2022-01-10 09:19:14
【问题描述】:

我最近在我们的 K8s 集群中托管了 Jupyterhub。我们将内存限制设置为 1GB,所以现在所有的 Jupyter 笔记本都采用这种配置。但是我们的笔记本是资源(内存和 CPU)密集型的,有些笔记本不是资源密集型的

那么,有没有办法为多个 jupyter pod 分配不同的资源?

我正在使用helm chart部署jupyterhub https://zero-to-jupyterhub.readthedocs.io/en/latest/jupyterhub/installation.html

【问题讨论】:

    标签: kubernetes jupyter-notebook jupyterhub


    【解决方案1】:

    如果您的 POD 由 DeploymentStateful set 管理,则没有其他选择。

    要么为具有不同配置的多个 Jupiter 笔记本创建不同的不同部署,要么将每个笔记本部署为具有资源要求的不同 POD

    我建议使用 VPA,它会自动扩展您的部署或有状态集并根据需要调整资源要求。

    查看有关 VPA 的更多信息:https://cloud.google.com/kubernetes-engine/docs/concepts/verticalpodautoscaler

    【讨论】:

      【解决方案2】:

      我们使用profiles 允许用户从不同大小的 pod 中进行选择。 Pod 都部署在大节点上,但用户可以选择是半节点还是全节点 Pod。

      作为示例,我们构建了 daskhub 配置(完整规范 here):

      daskhub:
        jupyterhub:
          singleuser:
            image:
            cpu:
              limit: 3.5
              guarantee: 3.5
            memory:
              limit: 22.5G
              guarantee: 22.5G
            profileList:
              - display_name: "default"
                description: "Default notebook size"
                default: true
              - display_name: "large"
                description: "Larger notebook allowance"
                kubespawner_override:
                  cpu_limit: 7.0
                  cpu_guarantee: 7.0
                  mem_limit: 45G
                  mem_guarantee: 45G
      

      它们都在 8CPU / 52GB 节点上生成,但其中两个较小的 pod 将在同一个节点上运行(假设 2 个用户选择“默认”)。

      【讨论】:

      • singleuser.profileList 选项看起来很有希望,将对其进行测试:)
      • 这个解决方案对我有用,非常感谢?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-12-15
      • 1970-01-01
      • 2016-10-09
      • 2016-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多