Abhilash KK
Abhilash KK

Reputation: 446

Can some one explain the kubernetes pod resource scaling

I am using kubernetes Replication controller for my application to run in GCP, the application is a dockerized image.

I want to configure the Pod creating while replication creation, I am using a cluster of 64cores.

Can someone explain what exactly the meaning of the resource portion of the yaml

resources:
 limits:
  cpu: "1"
requests:
  cpu: 500m

Please tell me about requests and cpu.

I want to allocate 60 CPU core for the particular rc(replication controller) because my application API initiate 60 parallel processes and the entire API need to run 4K processes to complete.

Thanks in advance.

Upvotes: 1

Views: 97

Answers (1)

AlexBrand
AlexBrand

Reputation: 12401

The resource block allows you to specify requests and limits for compute resources such as CPU and memory.

Requests are considered by the scheduler when it needs to select a node to run the pod. Limits, on the other hand, are a runtime concern that are applied to the workload through the container runtime.

In your specific example, you are defining a workload that needs at least 500m (or 0.5 CPU) to be scheduled on a node. That is, the pod will only run on nodes that have more than 0.5 CPU available. Once running, the pod will be limited or throttled to only use 1 CPU on the machine (Depending on your container runtime, your pod might be able to burst if there is no CPU contention).

You can find more detailed documentation here: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#how-pods-with-resource-limits-are-run

Upvotes: 2

Related Questions