Home > Back-end >  How can I launch a pod which run on a few small instance nodes in k8s?
How can I launch a pod which run on a few small instance nodes in k8s?

Time:10-06

I am launching a K8S cluster on AWS EKS with nodegroup. I spin up a few instances running as k8s nodes which has 4GiB and 2 vCPU.

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

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

CodePudding user response:

You cannot run one pod on several machines, just as you cannot have a single process on multiple physical devices. 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. Although machine resources (CPU, RAM) for each pod will be limited to that of the node (2 cores, 4GB RAM in your example).

CodePudding user response:

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. 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. 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:
  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.

  • Related