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

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript