-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timezone problem with kube-state-metrics #279
Comments
Master static pods are always running with UTC timezone, it would be not same timezone with worker nodes. It causes potential issues of time dependent works. - Fix: https://bugzilla.redhat.com/show_bug.cgi?id=1674170
Hi @Reamer , sorry for late response. Could you elaborate your issue ? |
Hi @bysnupy, Steps to reproduce:
With a time zone in kube-api pod, the time for the next cron job is reported not in UTC any more. The application of kube-state-metrics but still calculates with UTC. Now I have the same issue, which is described here kubernetes/kube-state-metrics#500 |
It's a good point @Reamer, I think it's not Personally I think |
@brancz Can I get your opinion whether you think we should revert the changes that were made in the linked pull requests for openshift-ansible? We did this because people complained when the api/controllers/etcd processes moved from host services to static pods without access to /etc/localtime which meant their log timestamps were different from the rest of the system. |
I've verified timezone influence for In my conclusion,
test1>
After changing UTC timezone to JST for only control plane. test2>
After stop test3>
|
We could implement a new ansible-playbook variable: This value will be set as env var or config parameter.. on the cluster-monitoring-operator deployment. If the cluster-monitoring-operator detects this variable / config value, it will add a TZ env var to the kube-state-metrics deploy. The kube-state-metrics can now translate the kubernetes metrics timezone to UTC or export the time values with +x values for its timezone so that prometheus can convert it to UTC. |
I think it'd be much better if everything were UTC than having components respecting different timezones. |
Personally I think one timezone is ideal situation on all the system. But real world is consist of various timezone, and most people take each region timezone for granted. If the system running as host process, then it's not problem, because the process is always running on the host timezone. If the system is based on container manner, then it isolated from host configuration. First of all, we should set a policy about running container manner. For instance, UTC is only available timezone against all system. Or prepare the way to control over timezone on the all system. We should consider the opinions of various sections specialist about this, it can lead to best result. |
Than we can not configure the cronjob schedule time in our timezone? |
No you can't - think global |
Anyway how we proceed with this issue? Kube Metrics time and all dependent alarms are odd. |
(sorry I was on vacation until just now) In general, monitoring is always done against UTC only, for all the reasons already laid out in this thread. I'm also for UTC always and everywhere, it's a widely used best practice in SRE. |
In this thread, |
I feel like this should be brought up on a broader level (probably at least on aos-devel), but yes I agree with this. |
In 2019 a timezone should be not an issue. What the problem to set the TZ environment variable? It could be done by a ansible fact like described above. From my side, it should be document that the timezone must be unique across the whole cluster. But the timezone should be managed by the user. You might be get an ideal solution but it is not a real world solution. Openshift is the enterprise version of kubernetes. Its mainly using inside onpremise datacenter. Supporting only UTC is bogus and breaks a lot IT process in (german) datacenters. The worst case would be that RedHat official supports UTC only. |
my opinion, for 3.x we should hostmount /etc/localtime into the kube-state-metrics container, just like we do with the api and etcd containers. for 4.x we should use UTC everywhere. We should not continue down this path. |
Opened #353 with the approach outlined by Eric. |
Hi @brancz, |
Hi
I updated my cluster yesterday with openshift-ansible with this commit openshift/openshift-ansible@8c77207
This commit changed the timezone in api, controller and etcd.
kube-state-metrics pod is still in UTC timezone and I get exactly this issue: kubernetes/kube-state-metrics#500
What can I do? It is possible to set the timezone also in kube-state-metric pod?
Openshift-Version:
If you need more information let me know.
The text was updated successfully, but these errors were encountered: