简体   繁体   English

我如何启动一个在 k8s 中的几个小实例节点上运行的 pod?

[英]How can I launch a pod which run on a few small instance nodes in k8s?

I am launching a K8S cluster on AWS EKS with nodegroup.我正在使用节点组在 AWS EKS 上启动 K8S 集群。 I spin up a few instances running as k8s nodes which has 4GiB and 2 vCPU.我启动了一些作为 k8s 节点运行的实例,这些节点具有 4GiB 和 2 个 vCPU。

How can I launch a pod which request 32GB memory and 8 vCPU.如何启动请求 32GB memory 和 8 个 vCPU 的 pod。 I am getting memory/cpu errors.我收到内存/CPU 错误。

Is there a way for one pod running on top of a few nodes?有没有办法让一个 pod 运行在几个节点之上?

How can I launch a pod which request 32GB memory and 8 vCPU. I am getting memory/cpu errors.

To get actual allocatable capacity of a worker node you do kubectl get node <node name> -o json | jq.status.capacity要获得工作节点的实际可分配容量,您可以执行kubectl get node <node name> -o json | jq.status.capacity kubectl get node <node name> -o json | jq.status.capacity . kubectl get node <node name> -o json | jq.status.capacity You will find that a worker node capacity is not determine by its instance type.您会发现工作节点容量不是由其实例类型决定的。

You can then create new node group with instance type like m5.4xlarge for workload requires 8 vCPU and 32GB or more.然后,您可以创建实例类型为 m5.4xlarge 的新节点组,因为工作负载需要 8 个 vCPU 和 32GB 或更多。 Or you can also modify the existing node group autoscaling group with larger instance type.或者您也可以将现有的节点组自动伸缩组修改为更大的实例类型。 Finally in your deployment spec, you use nodeSelector to direct the scheduler where to run your pod:最后在您的部署规范中,您使用nodeSelector来指示调度程序在何处运行您的 pod:

nodeselector:
  node.kubernetes.io/instance-type: m5.4xlarge

Is there a way for one pod running on top of a few nodes?

A pod can only run on a worker node. Pod 只能在工作节点上运行。

You cannot run one pod on several machines, just as you cannot have a single process on multiple physical devices.你不能在多台机器上运行一个 pod,就像你不能在多个物理设备上有一个进程一样。 But you can run a copy of the process and so there are a few workload controllers that can create and manage a number of identical pods for you.但是您可以运行该进程的副本,因此有一些工作负载控制器可以为您创建和管理许多相同的 pod。 Although machine resources (CPU, RAM) for each pod will be limited to that of the node (2 cores, 4GB RAM in your example).尽管每个 pod 的机器资源(CPU、RAM)将被限制为节点的资源(在您的示例中为 2 个内核、4GB RAM)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM