Kubernetes — Resource Request & Limit

Arun Prakash
2 min readJan 30, 2022

--

Though Kubernetes makes all our jobs simple by effectively distributing the containers across the nodes, Resource Allocation is always a key area to focus on, by the developers.

When you happen to see that, the pod is functioning properly with default values for the Resource request & Resource limit parameters in your YAML file, just be cautious. There is always a possibility, You gonna see OOMKilled — Container Limit Reached or OOMKilled — Limit Overcommit error sooner or later.

Kubernetes Resource Management

What will happen if you take this parameter lightly? Four scenarios can happen.

#1: When Resource requests & Resource limits are not set

This is the default case. Pods will be served on a First come first serve basis. There is a possibility for one pod to take all the available memory resulting in the eviction of all other pods.

#2: Resource requests are set (Ex: 200 MB), No Limit is set

Though the request is made only for 200 MB, there is a possibility that the pod may utilize whatever memory it likes.

#3: Only Resource limit is set (Ex: 200 MB), Without request

Kubernetes will automatically set a Resource request matching the limit which may not be the best case performance scenario.

#4: Resource request & Resource limit are set

The best case is to set Resource requests & Resource limits by yourself. But How? I just rely on the trial and error method to find
the value for this parameter. I think, a guessing game is the only solution here. (Maybe monitoring helps to make a relevant guess).

You may be a beginner or advanced Kubernetes user, but just make sure that these values are not set to default.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Arun Prakash
Arun Prakash

Written by Arun Prakash

I write about Cloud, DevOps and SRE Stuffs! Passionate about Security !

No responses yet

Write a response