Bug 1278683 - Column of Resource limits Request/Limit/Ratio are missing when describe a project which has limit set
Summary: Column of Resource limits Request/Limit/Ratio are missing when describe a pro...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 3.7.0
Assignee: Maciej Szulik
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-06 07:19 UTC by Liang Xia
Modified: 2019-04-09 23:37 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Missing columns in oc describe project for defined limits. Consequence: Limits output was not complete when describing a project. Fix: Adds the "Limit" and "Limit/Request" columns seen when describing a LimitRange to the "describe" output of projects. Result: The describe output of both project and limits is consistent.
Clone Of:
Environment:
Last Closed: 2019-04-09 23:36:59 UTC
Target Upstream Version:
Embargoed:
lxia: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0617 0 None None None 2019-04-09 23:37:01 UTC

Description Liang Xia 2015-11-06 07:19:35 UTC
Description of problem:
When describe a project which has limit set,
Column of Resource limits Request/Limit/Ratio are missing

Version-Release number of selected component (if applicable):
openshift v3.1.0.0
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
etcd 2.1.2
oc v3.1.0.0

How reproducible:
Always

Steps to Reproduce:
1.Create a project
$ oc new-project myproject
2.Create limit and apply to above project
$ oc create -f limit.yaml -n myproject
3.Check the project
$ oc describe project myproject

Actual results:
$ oc describe project proj1
Name:        proj1
Created:    About a minute ago
Labels:        <none>
Annotations:    openshift.io/description=
        openshift.io/display-name=
        openshift.io/sa.scc.mcs=s0:c7,c4
        openshift.io/sa.scc.supplemental-groups=1000050000/10000
        openshift.io/sa.scc.uid-range=1000050000/10000
Display Name:    <none>
Description:    <none>
Status:        Active
Node Selector:    <none>
Quota:        <none>
Resource limits:
    Name:        limits
    Type        Resource    Min    Max    Default
    ----        --------    ---    ---    ---
    Container    cpu        -    -    200m
    Container    memory        -    -    1Gi

Expected results:
Show full columns of resource limit.

Additional info:
$ oc describe limits limits
Name:        limits
Namespace:    proj1
Type        Resource    Min    Max    Request    Limit    Limit/Request
----        --------    ---    ---    -------    -----    -------------
Container    cpu        -    -    200m    200m    -
Container    memory        -    -    1Gi    1Gi    -

Comment 2 Liang Xia 2016-02-22 09:27:14 UTC
Still can be reproduced on version,
openshift v3.1.1.904
kubernetes v1.2.0-alpha.7-703-gbc4550d
etcd 2.2.5


$ oc describe project default --config=admin.kubeconfig
Name:		default
Created:	5 hours ago
Labels:		<none>
Annotations:	openshift.io/sa.initialized-roles=true
		openshift.io/sa.scc.mcs=s0:c1,c0
		openshift.io/sa.scc.supplemental-groups=1000000000/10000
		openshift.io/sa.scc.uid-range=1000000000/10000
Display Name:	<none>
Description:	<none>
Status:		Active
Node Selector:	<none>
Quota:		<none>
Resource limits:
	Name:		limits
	Type		Resource	Min	Max	Default
	----		--------	---	---	---
	Pod		cpu		10m	500m	-
	Pod		memory		5Mi	750Mi	-
	Container	cpu		10m	500m	100m
	Container	memory		5Mi	750Mi	100Mi



$ oc describe limits limits
Name:		limits
Namespace:	default
Type		Resource	Min	Max	Default Request	Default Limit	Max Limit/Request Ratio
----		--------	---	---	---------------	-------------	-----------------------
Pod		cpu		10m	500m	-		-		-
Pod		memory		5Mi	750Mi	-		-		-
Container	memory		5Mi	750Mi	100Mi		100Mi		-
Container	cpu		10m	500m	100m		100m		-

Comment 3 Juan Vallejo 2017-10-17 20:53:31 UTC
Origin PR: https://github.com/openshift/origin/pull/16918

Comment 4 Liang Xia 2017-10-27 07:33:08 UTC
Tested on below version, still can reproduce. Maybe the current build does not contain the fix yet. Will try again once we got a newer build.

openshift v3.7.0-0.181.0
kubernetes v1.7.6+a08f5eeb62

# oc describe project default
Name:		default
Created:	5 hours ago
Labels:		<none>
Annotations:	openshift.io/node-selector=
		openshift.io/sa.initialized-roles=true
		openshift.io/sa.scc.mcs=s0:c1,c0
		openshift.io/sa.scc.supplemental-groups=1000000000/10000
		openshift.io/sa.scc.uid-range=1000000000/10000
Display Name:	<none>
Description:	<none>
Status:		Active
Node Selector:	<none>
Quota:		<none>
Resource limits:
	Name:		resource-limits
	Type		Resource	Min	Max	Default
	----		--------	---	---	---
	Pod		memory		6Mi	1Gi	-
	Pod		cpu		200m	2	-
	Container	cpu		100m	2	300m
	Container	memory		4Mi	1Gi	200Mi

# oc describe limits
Name:		resource-limits
Namespace:	default
Type		Resource	Min	Max	Default Request	Default Limit	Max Limit/Request Ratio
----		--------	---	---	---------------	-------------	-----------------------
Pod		cpu		200m	2	-		-		-
Pod		memory		6Mi	1Gi	-		-		-
Container	memory		4Mi	1Gi	100Mi		200Mi		-
Container	cpu		100m	2	200m		300m		10

Comment 5 Liang Xia 2017-10-31 03:06:10 UTC
Checked on below version, you can see that limits in describe project and describe limit are different, assign back to get this fixed.

# openshift version
openshift v3.7.0-0.184.0
kubernetes v1.7.6+a08f5eeb62
etcd 3.2.8


# oc describe project default
Name:		default
Created:	2 hours ago
Labels:		<none>
Annotations:	openshift.io/node-selector=
		openshift.io/sa.initialized-roles=true
		openshift.io/sa.scc.mcs=s0:c1,c0
		openshift.io/sa.scc.supplemental-groups=1000000000/10000
		openshift.io/sa.scc.uid-range=1000000000/10000
Display Name:	<none>
Description:	<none>
Status:		Active
Node Selector:	<none>
Quota:		<none>
Resource limits:
	Name:		resource-limits
	Type		Resource	Min	Max	Default	Limit	Limit/Request
	----		--------	---	---	---	-----	-------------
	Pod		cpu		200m	2	-	-	-
	Pod		memory		6Mi	1Gi	-	-	-
	Container	memory		4Mi	1Gi	200Mi	200Mi	-
	Container	cpu		100m	2	300m	300m	10


# oc describe limits
Name:		resource-limits
Namespace:	default
Type		Resource	Min	Max	Default Request	Default Limit	Max Limit/Request Ratio
----		--------	---	---	---------------	-------------	-----------------------
Pod		cpu		200m	2	-		-		-
Pod		memory		6Mi	1Gi	-		-		-
Container	cpu		100m	2	200m		300m		10
Container	memory		4Mi	1Gi	100Mi		200Mi		-

Comment 6 Juan Vallejo 2017-10-31 14:33:03 UTC
> you can see that limits in describe project and describe limit are different

How are they different? Both display the same info about a limit range object, with some column names worded slightly different (Limit/Request vs. Limit/Request Ration)

Comment 7 Liang Xia 2017-11-02 01:22:12 UTC
You can see that they have different values in column of "Default" in project and "Default Request" in limit for Container cpu/memory.

Comment 9 Maciej Szulik 2019-02-26 11:18:42 UTC
This is working as expected since 3.7, moving to qa.

Comment 10 Liang Xia 2019-02-27 08:17:54 UTC
Checked on below version, you can see that limits in describe project and describe limit are different, assign back to get this fixed.

# oc version ; oc describe project myp ; oc describe limits resource-limits ; cat limit.yaml 
oc v3.7.98
kubernetes v1.7.6+a08f5eeb62
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://10.0.77.94:8443
openshift v3.7.98
kubernetes v1.7.6+a08f5eeb62
Name:		myp
Created:	3 hours ago
Labels:		<none>
Annotations:	openshift.io/description=
		openshift.io/display-name=
		openshift.io/requester=system:admin
		openshift.io/sa.scc.mcs=s0:c11,c5
		openshift.io/sa.scc.supplemental-groups=1000120000/10000
		openshift.io/sa.scc.uid-range=1000120000/10000
Display Name:	<none>
Description:	<none>
Status:		Active
Node Selector:	<none>
Quota:		<none>
Resource limits:
	Name:		resource-limits
	Type		Resource	Min	Max	Default	Limit	Limit/Request
	----		--------	---	---	---	-----	-------------
	Pod		cpu		200m	2	-	-	-
	Pod		memory		6Mi	1Gi	-	-	-
	Container	cpu		100m	2	300m	300m	10
	Container	memory		4Mi	1Gi	200Mi	200Mi	-
Name:		resource-limits
Namespace:	myp
Type		Resource	Min	Max	Default Request	Default Limit	Max Limit/Request Ratio
----		--------	---	---	---------------	-------------	-----------------------
Pod		memory		6Mi	1Gi	-		-		-
Pod		cpu		200m	2	-		-		-
Container	cpu		100m	2	200m		300m		10
Container	memory		4Mi	1Gi	100Mi		200Mi		-
apiVersion: "v1"
kind: "LimitRange"
metadata:
  name: "resource-limits" 
spec:
  limits:
    -
      type: "Pod"
      max:
        cpu: "2" 
        memory: "1Gi" 
      min:
        cpu: "200m" 
        memory: "6Mi" 
    -
      type: "Container"
      max:
        cpu: "2" 
        memory: "1Gi" 
      min:
        cpu: "100m" 
        memory: "4Mi" 
      default:
        cpu: "300m" 
        memory: "200Mi" 
      defaultRequest:
        cpu: "200m" 
        memory: "100Mi" 
      maxLimitRequestRatio:
        cpu: "10"

Comment 11 Liang Xia 2019-02-27 08:56:05 UTC
Proposed a PR, https://github.com/openshift/origin/pull/22165

Comment 12 Liang Xia 2019-02-27 09:03:01 UTC
Tested with above code change, and build the oc client locally, verified the issue described in #comment 10 is fixed.

# alias oc=~/github.com/liangxia/origin/_output/local/bin/linux/amd64/oc
# oc version ; oc describe project myp ; oc describe limits resource-limits ; cat limit.yaml 
Client Version: version.Info{Major:"", Minor:"", GitVersion:"v1.1+e30601b-20387-dirty", GitCommit:"e30601b178", GitTreeState:"", BuildDate:"2019-02-27T08:02:49Z", GoVersion:"", Compiler:"", Platform:""}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.6+a08f5eeb62", GitCommit:"c84beff", GitTreeState:"clean", BuildDate:"2019-02-23T19:32:12Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Name:		myp
Created:	3 hours ago
Labels:		<none>
Annotations:	openshift.io/description=
		openshift.io/display-name=
		openshift.io/requester=system:admin
		openshift.io/sa.scc.mcs=s0:c11,c5
		openshift.io/sa.scc.supplemental-groups=1000120000/10000
		openshift.io/sa.scc.uid-range=1000120000/10000
Display Name:	<none>
Description:	<none>
Status:		Active
Node Selector:	<none>
Quota:		<none>
Resource limits:
	Name:		resource-limits
	Type		Resource	Min	Max	Default Request	Default Limit	Max Limit/Request Ratio
	----		--------	---	---	---------------	-------------	-----------------------
	Pod		cpu		200m	2	-		-		-
	Pod		memory		6Mi	1Gi	-		-		-
	Container	memory		4Mi	1Gi	100Mi		200Mi		-
	Container	cpu		100m	2	200m		300m		10
Name:       resource-limits
Namespace:  myp
Type        Resource  Min   Max  Default Request  Default Limit  Max Limit/Request Ratio
----        --------  ---   ---  ---------------  -------------  -----------------------
Pod         cpu       200m  2    -                -              -
Pod         memory    6Mi   1Gi  -                -              -
Container   cpu       100m  2    200m             300m           10
Container   memory    4Mi   1Gi  100Mi            200Mi          -
apiVersion: "v1"
kind: "LimitRange"
metadata:
  name: "resource-limits" 
spec:
  limits:
    -
      type: "Pod"
      max:
        cpu: "2" 
        memory: "1Gi" 
      min:
        cpu: "200m" 
        memory: "6Mi" 
    -
      type: "Container"
      max:
        cpu: "2" 
        memory: "1Gi" 
      min:
        cpu: "100m" 
        memory: "4Mi" 
      default:
        cpu: "300m" 
        memory: "200Mi" 
      defaultRequest:
        cpu: "200m" 
        memory: "100Mi" 
      maxLimitRequestRatio:
        cpu: "10"

Comment 13 Maciej Szulik 2019-02-27 16:05:24 UTC
I don't think fix from https://github.com/openshift/origin/pull/22165 is needed. Can you please check newer versions?
I've tested that with a fresh build of 3.7 all the way up to 4.0 and it worked every single time.

Comment 14 Liang Xia 2019-03-06 03:13:27 UTC
Explains in the PR.

Comment 17 Liang Xia 2019-03-18 00:29:30 UTC
Fix for 3.7, https://github.com/openshift/ose/pull/1496 merged.

Comment 19 Liang Xia 2019-03-27 03:08:42 UTC

# oc version ; oc describe project default ; oc describe limits resource-limits -n default
oc v3.7.108
kubernetes v1.7.6+a08f5eeb62
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://10.0.77.0:8443
openshift v3.7.108
kubernetes v1.7.6+a08f5eeb62


Name:		default
Created:	4 hours ago
Labels:		<none>
Annotations:	openshift.io/logging.data.prefix=.operations
		openshift.io/node-selector=
		openshift.io/sa.initialized-roles=true
		openshift.io/sa.scc.mcs=s0:c1,c0
		openshift.io/sa.scc.supplemental-groups=1000000000/10000
		openshift.io/sa.scc.uid-range=1000000000/10000
Display Name:	<none>
Description:	<none>
Status:		Active
Node Selector:	<none>
Quota:		<none>
Resource limits:
	Name:		resource-limits
	Type		Resource	Min	Max	Default Request	Default Limit	Max Limit/Request Ratio
	----		--------	---	---	---------------	-------------	-----------------------
	Pod		memory		6Mi	1Gi	-		-		-
	Pod		cpu		200m	2	-		-		-
	Container	cpu		100m	2	200m		300m		10
	Container	memory		4Mi	1Gi	100Mi		200Mi		-
Name:		resource-limits
Namespace:	default
Type		Resource	Min	Max	Default Request	Default Limit	Max Limit/Request Ratio
----		--------	---	---	---------------	-------------	-----------------------
Pod		cpu		200m	2	-		-		-
Pod		memory		6Mi	1Gi	-		-		-
Container	cpu		100m	2	200m		300m		10
Container	memory		4Mi	1Gi	100Mi		200Mi		-

Comment 21 errata-xmlrpc 2019-04-09 23:36:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0617


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