How to change the timezone of containers running in k8s

  1. Change the timezone in the image(below commands needs to be modified according to the Linux distribution)
RUN rm -rf /etc/localtime
RUN ln -s /usr/share/zoneinfo/Asia/Singapore /etc/localtime
RUN dpkg-reconfigure -f noninteractive tzdata

2. Change the timezone via k8s mount hostPath

spec:

--

--

Interested in CloudNative | CKA&Azure Associate Admin&ITIL | https://github.com/Shuanglu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store