Resource allocation to pods in KubernetesAllocate or Limit resource for pods in Kubernetes?Allow only one pod of a type on a node in KubernetesAllocate or Limit resource for pods in Kubernetes?Restart pods when configmap updates in Kubernetes?Kubernetes pod distribution amongst nodesPod Resources MonitoringKubernetes cpu requests/limits in heterogeneous clusterkubernetes scheduling for expensive resourceswhat does kubernetes scheduler capacity check do or cover?How to calculate available free resources in a kubernetes nodeResource Allocation in Kubernetes: How are pods scheduled?

How do rulers get rich from war?

What are the end bytes of *.docx file format

Integrability of log of distance function

Is a global DNS record a security risk for phpMyAdmin?

Why was Java 8 left out from Debian Buster?

Cemented carbide swords - worth it?

Is there an in-universe reason Harry says this or is this simply a Rowling mistake?

What are sources for Magic Items that are not adventure-specific?

Debussy as term for bathroom?

Flying pigs arrive

Removing rows containing NA in every column

Audire, with accusative or dative?

What was the deeper meaning of Hermione wanting the cloak?

Is Zack Morris's 'time stop' ability in "Saved By the Bell" a supernatural ability?

All numbers in a 5x5 Minesweeper grid

Should I inform my future product owner that there is a good chance that a team member will leave the company soon?

Exam design: give maximum score per question or not?

Quick Kurodoko Puzzle: Threes and Triples

Weapon class firing logic in JavaScript

Is it safe to put a microwave in a walk-in closet?

Tips for remembering the order of parameters for ln?

Why would a fighter use the afterburner and air brakes at the same time?

I was cheated into a job and want to leave ASAP, what do I tell my interviewers?

siunitx redefines macros in pdf bookmarks



Resource allocation to pods in Kubernetes


Allocate or Limit resource for pods in Kubernetes?Allow only one pod of a type on a node in KubernetesAllocate or Limit resource for pods in Kubernetes?Restart pods when configmap updates in Kubernetes?Kubernetes pod distribution amongst nodesPod Resources MonitoringKubernetes cpu requests/limits in heterogeneous clusterkubernetes scheduling for expensive resourceswhat does kubernetes scheduler capacity check do or cover?How to calculate available free resources in a kubernetes nodeResource Allocation in Kubernetes: How are pods scheduled?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Assume that Kubernetes has scheduled two pods A and B in a node N. If the resource capacity of the Node N is (30 CPU, 70 Memory) and pod A requests (5 CPU, 8 memory) and pod B requestes (4 CPU, 10 memory), is it possible to share the resources among two pods in a way that we maintain the efficieny of the cluster and maximize the allocation of pods? How can I change the codes to achieve this? Assuming that each pod maintains 1 container.










share|improve this question



















  • 1





    What do you mean by "share the resources among two pods"? You can share a single node N if that's what you are asking; you will just need to configure the scheduler policy to configure Affinity/Anti-Affinity for close packing of your pods.

    – Frank Yucheng Gu
    Mar 28 at 14:45

















0















Assume that Kubernetes has scheduled two pods A and B in a node N. If the resource capacity of the Node N is (30 CPU, 70 Memory) and pod A requests (5 CPU, 8 memory) and pod B requestes (4 CPU, 10 memory), is it possible to share the resources among two pods in a way that we maintain the efficieny of the cluster and maximize the allocation of pods? How can I change the codes to achieve this? Assuming that each pod maintains 1 container.










share|improve this question



















  • 1





    What do you mean by "share the resources among two pods"? You can share a single node N if that's what you are asking; you will just need to configure the scheduler policy to configure Affinity/Anti-Affinity for close packing of your pods.

    – Frank Yucheng Gu
    Mar 28 at 14:45













0












0








0








Assume that Kubernetes has scheduled two pods A and B in a node N. If the resource capacity of the Node N is (30 CPU, 70 Memory) and pod A requests (5 CPU, 8 memory) and pod B requestes (4 CPU, 10 memory), is it possible to share the resources among two pods in a way that we maintain the efficieny of the cluster and maximize the allocation of pods? How can I change the codes to achieve this? Assuming that each pod maintains 1 container.










share|improve this question














Assume that Kubernetes has scheduled two pods A and B in a node N. If the resource capacity of the Node N is (30 CPU, 70 Memory) and pod A requests (5 CPU, 8 memory) and pod B requestes (4 CPU, 10 memory), is it possible to share the resources among two pods in a way that we maintain the efficieny of the cluster and maximize the allocation of pods? How can I change the codes to achieve this? Assuming that each pod maintains 1 container.







kubernetes






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 28 at 14:13









HamiBUHamiBU

526 bronze badges




526 bronze badges










  • 1





    What do you mean by "share the resources among two pods"? You can share a single node N if that's what you are asking; you will just need to configure the scheduler policy to configure Affinity/Anti-Affinity for close packing of your pods.

    – Frank Yucheng Gu
    Mar 28 at 14:45












  • 1





    What do you mean by "share the resources among two pods"? You can share a single node N if that's what you are asking; you will just need to configure the scheduler policy to configure Affinity/Anti-Affinity for close packing of your pods.

    – Frank Yucheng Gu
    Mar 28 at 14:45







1




1





What do you mean by "share the resources among two pods"? You can share a single node N if that's what you are asking; you will just need to configure the scheduler policy to configure Affinity/Anti-Affinity for close packing of your pods.

– Frank Yucheng Gu
Mar 28 at 14:45





What do you mean by "share the resources among two pods"? You can share a single node N if that's what you are asking; you will just need to configure the scheduler policy to configure Affinity/Anti-Affinity for close packing of your pods.

– Frank Yucheng Gu
Mar 28 at 14:45












1 Answer
1






active

oldest

votes


















1
















Kubernetes already does that.



Resource Requests are soft reservations, that means, the scheduler will consider it as a requirement when placing the pod in the node, it will allocate the resource to a POD but won't reserve the resources to be used exclusively by the pod that requested it.



If the POD request 1Gb of memory and consumed only 500Mb, other pods will be able to consume the remainder.



The main issue is when other PODs does not set limits, this will prevent the scheduler of controlling the load properly and other running pods might affect the pod. Other issue is when Limits are set too high and when being consumed will reach the node capacity.



To have a proper balance and efficiency, requests and limits should be set appropriately and prevent over-commitment.



This other SO shows a nice example of it: Allocate or Limit resource for pods in Kubernetes?






share|improve this answer

























  • Thanks for your response. If we assume that pod have not set resource limits, how can I indicate that the whole resources in the cluster will be divides fairly among those two pods. Actually, I would like to allocate all the resources only to those two pods.

    – HamiBU
    Mar 28 at 15:05











  • If you don't set limits, some pods will consume more resources than others,without limits there is no guarantee that the resources will be split fairly. You can add policies to restrict pod creation without limits. In case you need more resources to the pods, instead of letting the pod consume too much resource. you setup auto scale to add more replicas of it (if the application can split the processing). Other option instead of adding replicas, you deploy more pods with lower priority, when higher priority pods need more resources, other with lower priority get evicted from nodes.

    – Diego Mendes
    Apr 1 at 10:13










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55399744%2fresource-allocation-to-pods-in-kubernetes%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1
















Kubernetes already does that.



Resource Requests are soft reservations, that means, the scheduler will consider it as a requirement when placing the pod in the node, it will allocate the resource to a POD but won't reserve the resources to be used exclusively by the pod that requested it.



If the POD request 1Gb of memory and consumed only 500Mb, other pods will be able to consume the remainder.



The main issue is when other PODs does not set limits, this will prevent the scheduler of controlling the load properly and other running pods might affect the pod. Other issue is when Limits are set too high and when being consumed will reach the node capacity.



To have a proper balance and efficiency, requests and limits should be set appropriately and prevent over-commitment.



This other SO shows a nice example of it: Allocate or Limit resource for pods in Kubernetes?






share|improve this answer

























  • Thanks for your response. If we assume that pod have not set resource limits, how can I indicate that the whole resources in the cluster will be divides fairly among those two pods. Actually, I would like to allocate all the resources only to those two pods.

    – HamiBU
    Mar 28 at 15:05











  • If you don't set limits, some pods will consume more resources than others,without limits there is no guarantee that the resources will be split fairly. You can add policies to restrict pod creation without limits. In case you need more resources to the pods, instead of letting the pod consume too much resource. you setup auto scale to add more replicas of it (if the application can split the processing). Other option instead of adding replicas, you deploy more pods with lower priority, when higher priority pods need more resources, other with lower priority get evicted from nodes.

    – Diego Mendes
    Apr 1 at 10:13















1
















Kubernetes already does that.



Resource Requests are soft reservations, that means, the scheduler will consider it as a requirement when placing the pod in the node, it will allocate the resource to a POD but won't reserve the resources to be used exclusively by the pod that requested it.



If the POD request 1Gb of memory and consumed only 500Mb, other pods will be able to consume the remainder.



The main issue is when other PODs does not set limits, this will prevent the scheduler of controlling the load properly and other running pods might affect the pod. Other issue is when Limits are set too high and when being consumed will reach the node capacity.



To have a proper balance and efficiency, requests and limits should be set appropriately and prevent over-commitment.



This other SO shows a nice example of it: Allocate or Limit resource for pods in Kubernetes?






share|improve this answer

























  • Thanks for your response. If we assume that pod have not set resource limits, how can I indicate that the whole resources in the cluster will be divides fairly among those two pods. Actually, I would like to allocate all the resources only to those two pods.

    – HamiBU
    Mar 28 at 15:05











  • If you don't set limits, some pods will consume more resources than others,without limits there is no guarantee that the resources will be split fairly. You can add policies to restrict pod creation without limits. In case you need more resources to the pods, instead of letting the pod consume too much resource. you setup auto scale to add more replicas of it (if the application can split the processing). Other option instead of adding replicas, you deploy more pods with lower priority, when higher priority pods need more resources, other with lower priority get evicted from nodes.

    – Diego Mendes
    Apr 1 at 10:13













1














1










1









Kubernetes already does that.



Resource Requests are soft reservations, that means, the scheduler will consider it as a requirement when placing the pod in the node, it will allocate the resource to a POD but won't reserve the resources to be used exclusively by the pod that requested it.



If the POD request 1Gb of memory and consumed only 500Mb, other pods will be able to consume the remainder.



The main issue is when other PODs does not set limits, this will prevent the scheduler of controlling the load properly and other running pods might affect the pod. Other issue is when Limits are set too high and when being consumed will reach the node capacity.



To have a proper balance and efficiency, requests and limits should be set appropriately and prevent over-commitment.



This other SO shows a nice example of it: Allocate or Limit resource for pods in Kubernetes?






share|improve this answer













Kubernetes already does that.



Resource Requests are soft reservations, that means, the scheduler will consider it as a requirement when placing the pod in the node, it will allocate the resource to a POD but won't reserve the resources to be used exclusively by the pod that requested it.



If the POD request 1Gb of memory and consumed only 500Mb, other pods will be able to consume the remainder.



The main issue is when other PODs does not set limits, this will prevent the scheduler of controlling the load properly and other running pods might affect the pod. Other issue is when Limits are set too high and when being consumed will reach the node capacity.



To have a proper balance and efficiency, requests and limits should be set appropriately and prevent over-commitment.



This other SO shows a nice example of it: Allocate or Limit resource for pods in Kubernetes?







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 28 at 14:43









Diego MendesDiego Mendes

6,5021 gold badge20 silver badges29 bronze badges




6,5021 gold badge20 silver badges29 bronze badges















  • Thanks for your response. If we assume that pod have not set resource limits, how can I indicate that the whole resources in the cluster will be divides fairly among those two pods. Actually, I would like to allocate all the resources only to those two pods.

    – HamiBU
    Mar 28 at 15:05











  • If you don't set limits, some pods will consume more resources than others,without limits there is no guarantee that the resources will be split fairly. You can add policies to restrict pod creation without limits. In case you need more resources to the pods, instead of letting the pod consume too much resource. you setup auto scale to add more replicas of it (if the application can split the processing). Other option instead of adding replicas, you deploy more pods with lower priority, when higher priority pods need more resources, other with lower priority get evicted from nodes.

    – Diego Mendes
    Apr 1 at 10:13

















  • Thanks for your response. If we assume that pod have not set resource limits, how can I indicate that the whole resources in the cluster will be divides fairly among those two pods. Actually, I would like to allocate all the resources only to those two pods.

    – HamiBU
    Mar 28 at 15:05











  • If you don't set limits, some pods will consume more resources than others,without limits there is no guarantee that the resources will be split fairly. You can add policies to restrict pod creation without limits. In case you need more resources to the pods, instead of letting the pod consume too much resource. you setup auto scale to add more replicas of it (if the application can split the processing). Other option instead of adding replicas, you deploy more pods with lower priority, when higher priority pods need more resources, other with lower priority get evicted from nodes.

    – Diego Mendes
    Apr 1 at 10:13
















Thanks for your response. If we assume that pod have not set resource limits, how can I indicate that the whole resources in the cluster will be divides fairly among those two pods. Actually, I would like to allocate all the resources only to those two pods.

– HamiBU
Mar 28 at 15:05





Thanks for your response. If we assume that pod have not set resource limits, how can I indicate that the whole resources in the cluster will be divides fairly among those two pods. Actually, I would like to allocate all the resources only to those two pods.

– HamiBU
Mar 28 at 15:05













If you don't set limits, some pods will consume more resources than others,without limits there is no guarantee that the resources will be split fairly. You can add policies to restrict pod creation without limits. In case you need more resources to the pods, instead of letting the pod consume too much resource. you setup auto scale to add more replicas of it (if the application can split the processing). Other option instead of adding replicas, you deploy more pods with lower priority, when higher priority pods need more resources, other with lower priority get evicted from nodes.

– Diego Mendes
Apr 1 at 10:13





If you don't set limits, some pods will consume more resources than others,without limits there is no guarantee that the resources will be split fairly. You can add policies to restrict pod creation without limits. In case you need more resources to the pods, instead of letting the pod consume too much resource. you setup auto scale to add more replicas of it (if the application can split the processing). Other option instead of adding replicas, you deploy more pods with lower priority, when higher priority pods need more resources, other with lower priority get evicted from nodes.

– Diego Mendes
Apr 1 at 10:13








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid …


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55399744%2fresource-allocation-to-pods-in-kubernetes%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?