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:
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.
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.
Upstream PR addressing `Age` column in v1.18: https://github.com/kubernetes/kubernetes/pull/93663
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).
Upstream PR addressing `From` column in master: https://github.com/kubernetes/kubernetes/pull/93687
@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
Yes, it does.
(In reply to Jan Chaloupka from comment #7) > Yes, it does. Thanks !!
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).
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.
Putting UpcomingSprint just in case the PR does not get merged EOW
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.
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