Bug 1333079 - Not easy to grasp limit calculations
Summary: Not easy to grasp limit calculations
Keywords:
Status: CLOSED DUPLICATE of bug 1333029
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Website
Version: 3.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Abhishek Gupta
QA Contact: Yanping Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-04 15:28 UTC by Maciej Szulik
Modified: 2016-05-05 09:37 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-04 17:48:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Maciej Szulik 2016-05-04 15:28:50 UTC
Description of problem:
I'm creating a pod with following limits:

apiVersion: v1
kind: Pod
metadata:
  name: pod-with-resources
spec:
  containers:
  - capabilities: {}
    image: gcr.io/google_containers/serve_hostname
    imagePullPolicy: IfNotPresent
    name: kubernetes-serve-hostname
    resources:
      limits:
        cpu: 30mi
        memory: 150Mi

I'm getting an error saying:

Error from server: error when creating "pod.yaml": pods "pod-with-resources" is forbidden: [Minimum cpu usage per Pod is 30m, but request is 17m., Minimum memory usage per Pod is 150Mi, but request is 94371840., Minimum memory usage per Container is 150Mi, but request is 90Mi., Minimum cpu usage per Container is 30m, but request is 17m.]

Where does 90Mi (for memory) or 17m (for cpu) gets from?

After digging a while I found the memory limit has to be 60% of what I've specified and that value must be above that minimum (here 150Mi). So to fit into that limit I need to do 150/.6=250 with that I'm still getting error,
but this time regarding just cpu. Increasing it doesn't change the error message. After another series of tinkering I found that it has to be 200% of memory limit and additionally you need to take 6% of it to be above the min
limit.

This is all nice and fancy, but me as a regular user, where do I get those values from? How I know those calculations? These are hard, not easily understandable.

Comment 1 Dan McPherson 2016-05-04 17:48:11 UTC

*** This bug has been marked as a duplicate of bug 1333029 ***

Comment 2 Xingxing Xia 2016-05-05 09:37:57 UTC
Already discussed in https://bugzilla.redhat.com/show_bug.cgi?id=1324825
Seems quite confusing many people, 'cause there are different people reporting: bug 1324825, bug 1333029, and this bug.
The root cause is: CLI can oc get limitrange and shows the range to user (which is not working for value between 150 - 250Mi due to ClusterResourceOverrideConfig is used, but the behavior is indeed working as intended)


Note You need to log in before you can comment on or make changes to this bug.