Hide Forgot
Description of problem: When cron jobs are run the time of the master controller is used. Since 3.10+ the service is run in a container and does not get the correct local time. https://docs.openshift.com/container-platform/3.10/dev_guide/cron_jobs.html#creating-a-cronjob Additional info: Mount /etc/localtime in the controller pods. https://github.com/openshift/openshift-ansible/blob/release-3.10/roles/openshift_control_plane/tasks/static.yml#L98 https://github.com/openshift/openshift-ansible/blob/release-3.11/roles/openshift_control_plane/files/controller.yaml#L30 # tail -n 37 /etc/origin/node/pods/controller.yaml volumeMounts: ... - mountPath: /etc/localtime name: localtime volumes: ... - hostPath: path: /etc/localtime name: localtime
Nothing the installer can/should do about this.
Meant to link 3.10 https://github.com/openshift/openshift-ansible/blob/release-3.10/roles/openshift_control_plane/files/controller.yaml#L42 3.11 already has this PR: https://github.com/openshift/openshift-ansible/commit/8c77207289a9ae8b1c3f565aba45d662e62a9fb3 This is a duplicate of this bug. https://bugzilla.redhat.com/show_bug.cgi?id=1674170
I don't think that bug did anything to address cron jobs, only apiserver and controllers. Won't the cron jobs start a new pod that likely won't have /etc/localtime mounted up?
Cronjobs are scheduled based on the local time of the master controller, in 3.10 we do not mount /etc/localtime in the master pods.
Sorry, I misinterpreted the bug to mean that the logs in the cron job based pods were incorrect. https://github.com/openshift/openshift-ansible/pull/11373 to backport this to 3.10, we should look into this noted problem before doing so however https://github.com/openshift/cluster-monitoring-operator/issues/279
https://github.com/openshift/openshift-ansible/pull/11373 is merged
*** Bug 1717840 has been marked as a duplicate of this bug. ***
Failed. openshift-ansible-3.10.149-1.git.0.eb0262c.el7 Seems mount does not handle link as expected. There is no difference mount or not mount hostPath /etc/localtime [root@ip-172-18-10-138 ~]# oc rsh pod/master-api-ip-172-18-10-138.ec2.internal sh-4.2# ls -l /etc/localtime lrwxrwxrwx. 1 root root 25 May 30 11:31 /etc/localtime -> ../usr/share/zoneinfo/UTC sh-4.2# exit [root@ip-172-18-10-138 ~]# ls -l /etc/localtime lrwxrwxrwx. 1 root root 38 Jun 16 18:22 /etc/localtime -> ../usr/share/zoneinfo/America/New_York
Fixed. openshift-ansible-3.10.153-1.git.0.2363fa8.el7 Time in master controller/apiserver pod is the same with the host. Although ls -l /etc/localtime in pod is different with it on host as comment 9 .
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:2509