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.
Mount /etc/localtime in the controller pods.
# tail -n 37 /etc/origin/node/pods/controller.yaml
- mountPath: /etc/localtime
Nothing the installer can/should do about this.
Meant to link 3.10
3.11 already has this PR:
This is a duplicate of this bug.
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/openshift-ansible/pull/11373 is merged
*** Bug 1717840 has been marked as a duplicate of this bug. ***
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
[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
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.