Bug 1861683 - Can't show the custom scheduler and default-scheduler name correctly
Summary: Can't show the custom scheduler and default-scheduler name correctly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: kube-scheduler
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.6.0
Assignee: Jan Chaloupka
QA Contact: RamaKasturi
URL:
Whiteboard:
Depends On:
Blocks: 1877805
TreeView+ depends on / blocked
 
Reported: 2020-07-29 09:28 UTC by zhou ying
Modified: 2020-10-27 16:21 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1877805 (view as bug list)
Environment:
Last Closed: 2020-10-27 16:21:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubernetes kubernetes pull 94226 0 None closed Automated cherry pick of #90227: kubectl: fix the Scheduled eventTime is <unknown> when use kubectl describe pod xxx 2020-09-21 11:18:27 UTC
Github kubernetes kubernetes pull 94475 0 None closed Automated cherry pick of #93687: kubectl describe pod: use ReportingController as an event source 2020-09-21 11:18:27 UTC
Github openshift kubernetes-kubectl pull 30 0 None closed UPSTREAM: 93687: kubectl describe pod: use ReportingController as an event source 2020-09-21 11:18:26 UTC
Github openshift oc pull 559 0 None closed bug 1861683: Bump k8s.io/kubectl to pick https://github.com/openshift/kubernetes-kubectl/pull/30 2020-09-21 11:18:27 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:21:39 UTC

Description zhou ying 2020-07-29 09:28:12 UTC
Description of problem:
When deploy a pod with custom scheduler can't show the custom scheduler name correctly on the Event

Version-Release number of selected component (if applicable):
4.6.0-0.nightly-2020-07-25-091217

How reproducible:
always

Steps to Reproduce:
1) Deploy custom scheduler named "my-scheduler"
2) Create a pod to use the custom scheduler with yaml :
[root@dhcp-140-138 ~]# cat /tmp/annotation-second-scheduler.yaml 
apiVersion: v1
kind: Pod
metadata:
  name: annotation-second-scheduler
  labels:
    name: multischeduler-example
spec:
  schedulerName: my-scheduler
  containers:
  - name: pod-with-no-annotation-container
    image: "quay.io/openshifttest/pause@sha256:b31bfb4d0213f254d361e0079deaaebefa4f82ba7aa76ef82e90b4935ad5b105"
3) Check the name of the scheduler for the pod

Actual results:
3) Show nothing for the scheduler name , and show <unknown> for the Age.

[root@dhcp-140-138 ~]# oc describe po/annotation-second-scheduler
Name:         annotation-second-scheduler
Namespace:    zhouyt2
Events:
  Type    Reason          Age        From                                                 Message
  ----    ------          ----       ----                                                 -------
  Normal  Scheduled       <unknown>                                                       Successfully assigned zhouyt2/annotation-second-scheduler to ip-xxx

Expected results:
3. Show the scheduler name and Age  correctly 


Additional info:

Comment 1 Jan Chaloupka 2020-08-04 11:53:20 UTC
Age is not properly set since FirstTimestamp, resp. LastTimestamp fields are not set due to the fact both fields are deprecated with 1.19 (core event type is replaced with event v1 type) and not properly set in 1.18 or less (core event type is replaced with event v1beta1 type). The way the Age is computed will need to change eventually.

In 4.5 or less the solution is to set both DeprecatedLastTimestamp and DeprecatedFirstTimestamp when issuing v1beta1 event. Which, when converted to the core event type gets translated into LastTimestamp and FirstTimestamp.
In 4.6 different approach is required since both fields are no longer set.

Comment 2 Jan Chaloupka 2020-08-04 11:55:54 UTC
From field is read from core event's Source field which is deprecated as well. There's a DeprecatedSource field which can not be set in 1.19 as well. New v1 event has a ReportingController field which can be used instead.

Comment 3 Jan Chaloupka 2020-08-04 13:29:13 UTC
Upstream PR addressing `Age` column in v1.18: https://github.com/kubernetes/kubernetes/pull/93663

Comment 4 Jan Chaloupka 2020-08-04 16:05:13 UTC
In 4.6 the Age column is properly set through https://github.com/openshift/oc/commit/bda51beaf869421bba0ce4eb32602d3af05497f2#diff-03ff3bfb36119113ef012cfe8771c5c6R3872-R3874 (oc rebase to 1.19.0-rc.1) so no need to address that anymore (tested locally).

Comment 5 Jan Chaloupka 2020-08-04 16:23:51 UTC
Upstream PR addressing `From` column in master: https://github.com/kubernetes/kubernetes/pull/93687

Comment 6 RamaKasturi 2020-08-06 16:09:26 UTC
@jan chaloupka, i see that not only custom-scheduler but cannot see default-scheduler name as well. See the describe below. I see the bug is already in POST state, hopefully the PR fixes this issue as well. could you please confirm ?

      [15:42:00] INFO> Shell Commands: oc describe pods no-scheduler --kubeconfig=/home/ramakasturinarra/workdir/dhcp35-60-ramakasturinarra/ocp4_testuser-18.kubeconfig
      Name:         no-scheduler
      Namespace:    i8lqc
      Priority:     0
      Node:         ip-10-0-59-92.us-east-2.compute.internal/10.0.59.92
      Start Time:   Thu, 06 Aug 2020 21:11:54 +0530
      Labels:       <none>
      Annotations:  k8s.v1.cni.cncf.io/network-status:
                      [{
                          "name": "",
                          "interface": "eth0",
                          "ips": [
                              "10.131.0.189"
                          ],
                          "default": true,
                          "dns": {}
                      }]
                    k8s.v1.cni.cncf.io/networks-status:
                      [{
                          "name": "",
                          "interface": "eth0",
                          "ips": [
                              "10.131.0.189"
                          ],
                          "default": true,
                          "dns": {}
                      }]
                    openshift.io/scc: restricted
      Status:       Running
      IP:           10.131.0.189
      IPs:
        IP:  10.131.0.189
      Containers:
        hello:
          Container ID:   cri-o://586d5e936cbb6001d4d8e1b186f5c84af77870dcaff9e7e57ab6518e28b0b12a
          Image:          quay.io/openshifttest/hello-pod@sha256:04b6af86b03c1836211be2589db870dba09b7811c197c47c07fbbe33c7f80ef7
          Image ID:       quay.io/openshifttest/hello-pod@sha256:04b6af86b03c1836211be2589db870dba09b7811c197c47c07fbbe33c7f80ef7
          Port:           <none>
          Host Port:      <none>
          State:          Running
            Started:      Thu, 06 Aug 2020 21:11:57 +0530
          Ready:          True
          Restart Count:  0
          Environment:    <none>
          Mounts:
            /var/run/secrets/kubernetes.io/serviceaccount from default-token-ldsc6 (ro)
      Conditions:
        Type              Status
        Initialized       True 
        Ready             True 
        ContainersReady   True 
        PodScheduled      True 
      Volumes:
        default-token-ldsc6:
          Type:        Secret (a volume populated by a Secret)
          SecretName:  default-token-ldsc6
          Optional:    false
      QoS Class:       BestEffort
      Node-Selectors:  <none>
      Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                       node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
      Events:
        Type    Reason          Age   From                                               Message
        ----    ------          ----  ----                                               -------
        Normal  Scheduled       8s                                                       Successfully assigned i8lqc/no-scheduler to ip-10-0-59-92.us-east-2.compute.internal
        Normal  AddedInterface  7s    multus                                             Add eth0 [10.131.0.189/23]
        Normal  Pulled          6s    kubelet, ip-10-0-59-92.us-east-2.compute.internal  Container image "quay.io/openshifttest/hello-pod@sha256:04b6af86b03c1836211be2589db870dba09b7811c197c47c07fbbe33c7f80ef7" already present on machine
        Normal  Created         6s    kubelet, ip-10-0-59-92.us-east-2.compute.internal  Created container hello
        Normal  Started         6s    kubelet, ip-10-0-59-92.us-east-2.compute.internal  Started container hello

Comment 7 Jan Chaloupka 2020-08-18 08:51:35 UTC
Yes, it does.

Comment 8 RamaKasturi 2020-08-18 08:52:55 UTC
(In reply to Jan Chaloupka from comment #7)
> Yes, it does.

Thanks !!

Comment 9 Jan Chaloupka 2020-08-25 15:03:56 UTC
Backporting https://github.com/kubernetes/kubernetes/pull/90227 to 1.18 as a replacement for https://github.com/kubernetes/kubernetes/pull/93663 (which got closed as not sufficient solution).

Comment 10 Jan Chaloupka 2020-08-26 12:34:37 UTC
All the fixes are merged in upstream master branch. I will wait until 1.19 GA is rebased and underlying BZ is in MODIFIED state.

Comment 11 Jan Chaloupka 2020-09-10 14:16:10 UTC
Putting UpcomingSprint just in case the PR does not get merged EOW

Comment 13 RamaKasturi 2020-09-14 15:00:55 UTC
Tried on the latest payload and i see that the default and custom scheduler names are being reflected and age as well. Also tests related to these are passing now.

 [13:44:17] INFO> Shell Commands: oc version -o yaml --client --kubeconfig=/tmp/kubeconfig20200914-380-16x6ea5
      clientVersion:
        buildDate: "2020-09-12T02:49:22Z"
        compiler: gc
        gitCommit: a4a051198b64f2e8bbfe9fc08c9a2728c7628e0e
        gitTreeState: clean
        gitVersion: 4.6.0-202009120210.p0-a4a0511
        goVersion: go1.14.7
        major: ""
        minor: ""
        platform: linux/amd64

server version: 4.6.0-0.nightly-2020-09-12-230035

Deploy custom scheduler:
==========================
Events:
        Type    Reason          Age   From               Message
        ----    ------          ----  ----               -------
        Normal  Scheduled       5s    default-scheduler  Successfully assigned doy32/no-annotation to ip-10-0-159-125.us-east-2.compute.internal
        Normal  AddedInterface  3s    multus             Add eth0 [10.128.2.130/23]
        Normal  Pulled          3s    kubelet            Container image "quay.io/openshifttest/pause@sha256:b31bfb4d0213f254d361e0079deaaebefa4f82ba7aa76ef82e90b4935ad5b105" already present on machine
        Normal  Created         3s    kubelet            Created container pod-with-no-annotation-container
        Normal  Started         3s    kubelet            Started container pod-with-no-annotation-container

Events:
        Type    Reason          Age   From               Message
        ----    ------          ----  ----               -------
        Normal  Scheduled       4s    default-scheduler  Successfully assigned doy32/annotation-default-scheduler to ip-10-0-159-125.us-east-2.compute.internal
        Normal  AddedInterface  2s    multus             Add eth0 [10.128.2.131/23]
        Normal  Pulled          1s    kubelet            Container image "quay.io/openshifttest/pause@sha256:b31bfb4d0213f254d361e0079deaaebefa4f82ba7aa76ef82e90b4935ad5b105" already present on machine
        Normal  Created         1s    kubelet            Created container pod-with-no-annotation-container
        Normal  Started         1s    kubelet            Started container pod-with-no-annotation-container

 Events:
        Type    Reason          Age   From          Message
        ----    ------          ----  ----          -------
        Normal  Scheduled       17s   my-scheduler  Successfully assigned doy32/annotation-second-scheduler to ip-10-0-189-241.us-east-2.compute.internal
        Normal  AddedInterface  15s   multus        Add eth0 [10.131.0.20/23]
        Normal  Pulled          7s    kubelet       Container image "quay.io/openshifttest/pause@sha256:b31bfb4d0213f254d361e0079deaaebefa4f82ba7aa76ef82e90b4935ad5b105" already present on machine
        Normal  Created         6s    kubelet       Created container pod-with-no-annotation-container
        Normal  Started         6s    kubelet       Started container pod-with-no-annotation-container

When no scheduler name is supplied, the pod is automatically scheduled using the default-scheduler:
==================================================================================================
   Events:
        Type    Reason          Age   From               Message
        ----    ------          ----  ----               -------
        Normal  Scheduled       5s    default-scheduler  Successfully assigned ii1w7/no-scheduler to ip-10-0-159-125.us-east-2.compute.internal
        Normal  AddedInterface  4s    multus             Add eth0 [10.128.2.132/23]
        Normal  Pulled          3s    kubelet            Container image "quay.io/openshifttest/hello-pod@sha256:04b6af86b03c1836211be2589db870dba09b7811c197c47c07fbbe33c7f80ef7" already present on machine
        Normal  Created         3s    kubelet            Created container hello
        Normal  Started         3s    kubelet            Started container hello

Based on the above info moving the bug to verified state.

Comment 17 errata-xmlrpc 2020-10-27 16:21:20 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 (OpenShift Container Platform 4.6 GA Images), 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-2020:4196


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