Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes Node Memory Limits

Tags:

kubernetes

I'm a beginner on Kubernetes. When I described my node, I saw this at the very bottom:

kubectl describe node ip-x-x-x-x.ap-southeast-2.compute.internal 

...

Allocated resources:
(Total limits may be over 100 percent, i.e., overcommitted.)
CPU Requests  CPU Limits  Memory Requests  Memory Limits
------------  ----------  ---------------  -------------
225m (11%)    200m (10%)  125Mi (1%)       300Mi (3%)
Events:         <none>

How do I un-limit the memory + cpu?

like image 435
krisanalfa Avatar asked Jun 18 '18 14:06

krisanalfa


People also ask

How much memory of a node does Kubernetes require as overhead?

As always, there is no definite answer. The type of applications that you want to deploy to the cluster may guide your decision. For example, if your application requires 10 GB of memory, you probably shouldn't use small nodes — the nodes in your cluster should have at least 10 GB of memory.

How does memory limit work in Kubernetes?

Just like CPU, if you put in a memory request that is larger than the amount of memory on your nodes, the pod will never be scheduled. Unlike CPU resources, memory cannot be compressed. Because there is no way to throttle memory usage, if a container goes past its memory limit it will be terminated.

How much RAM do I need for Kubernetes?

Each node in your cluster must have at least 300 MiB of memory.


Video Answer


1 Answers

Every node has limits according to its resources: number of processors or cores, amount of memory. Kubernetes uses this information for distributing Pods across Nodes.

Referring to the official documentation:

- Meaning of CPU
One CPU, in Kubernetes, is equivalent to:
- 1 AWS vCPU
- 1 GCP Core
- 1 Azure vCore
- 1 Hyperthread on a bare-metal Intel processor with Hyperthreading
1 CPU is 1000m (1 thousand milicores)

- Meaning of memory. It is an amount of memory on the server.

In the output from kubectl describe node <node-name> command, you see statistics of resource usage. Actually, resources of your server can be counted from the example in question, it is 2 CPUs/Cores and around 10000 MB of memory.

Please note that some resources are already allocated by system Pods like kube-dns, kube-proxy or kubernetes-dashboard.

like image 187
Artem Golenyaev Avatar answered Nov 11 '22 11:11

Artem Golenyaev