How to change the entire Kubernetes cluster time zone

Viewed 3999

I have a running kubernetes cluster in GCE and currently it is having the default time zone UTC. Now I need to change the time zone for the entire cluster(Not for a single node or a pod). Please let me know How can I do that?

1 Answers

It appears that you will not be able to globally set the TimeZone (TZ) in a cluster.

You can find more detailed information about the reason in this response How to change TimeZone of entire Kubernetes cluster?.

However the solutions that are offered in that post could be "temporary" when working with clusters in GCE that by default uses Container-Optimized OS.

Check this documentation Using Container-Optimized OS:

Container-Optimized OS is the default node OS Image in Kubernetes Engine and other Kubernetes deployments on Google Cloud Platform. See the Kubernetes Engine Quickstart for more information on using Container-Optimized OS with Kubernetes Engine.

Then lets see Changing the time zone, keeping in mind that:

Note that /etc is stateless, so the time zone will be reset to the default (UTC0) every reboot.

So, If you don't use an Ubuntu Image Type for your nodes (Container-Optimized OS is the default), you have nothing to do with time zone settings.

See Available node imagesto know the node images available for Google Kubernetes Engine (GKE) nodes.

Related