Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1688739 - `oc adm top pod` would treat memory usage < 1Mi as 0Mi
Summary: `oc adm top pod` would treat memory usage < 1Mi as 0Mi
Keywords:
Status: NEW
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod
Version: 4.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Seth Jennings
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-14 10:48 UTC by Junqi Zhao
Modified: 2019-03-14 10:50 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description Junqi Zhao 2019-03-14 10:48:17 UTC
Description of problem:
create one project named test and create deployment in project

deployment file see below
**************************************
apiVersion: apps/v1
kind: Deployment
metadata:
  name: example
  namespace: test
spec:
  selector:
    matchLabels:
      app: hello-openshift
  replicas: 1
  template:
    metadata:
      labels:
        app: hello-openshift
    spec:
      containers:
        - name: hello-openshift
          image: openshift/hello-openshift
          ports:
            - containerPort: 8080
**************************************

$ oc -n test get pod
NAME                       READY   STATUS    RESTARTS   AGE
example-744756c565-n5s59   1/1     Running   0          3m6s
[juzhao@localhost ~]$ oc -n test adm top pod example-744756c565-n5s59 --loglevel=8
.......................
I0314 18:43:20.745671    3159 request.go:942] Response Body: {"kind":"PodMetrics","apiVersion":"metrics.k8s.io/v1beta1","metadata":{"name":"example-744756c565-n5s59","namespace":"test","selfLink":"/apis/metrics.k8s.io/v1beta1/namespaces/test/pods/example-744756c565-n5s59","creationTimestamp":"2019-03-14T10:43:20Z"},"timestamp":"2019-03-14T10:43:20Z","window":"1m0s","containers":[{"name":"hello-openshift","usage":{"cpu":"0","memory":"788Ki"}}]}
NAME                       CPU(cores)   MEMORY(bytes)   
example-744756c565-n5s59   0m           0Mi             


from the logs, we see memory usage is 788Ki, but `oc adm top pod` treats memory usage as 0Mi


Version-Release number of selected component (if applicable):
payload: 4.0.0-0.nightly-2019-03-13-233958

$ oc version
oc v4.0.0-0.182.0
kubernetes v1.12.4+4dd65df23d
features: Basic-Auth GSSAPI Kerberos SPNEGO


How reproducible:
always

Steps to Reproduce:
1. See desription part
2.
3.

Actual results:
`oc adm top pod` would treat memory usage < 1Mi as 0Mi

Expected results:


Additional info:


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