My local time is GMT+7 ,but all containers uses UTC
$ date
Sat Apr 18 22:43:22 +07 2020
$ kubectl exec -it nginx-ingress-controller-7fcf8df75d-7rd2l -n ingress-nginx -- date
Sat Apr 18 15:43:24 UTC 2020
This is how.
At deployment spec insert “volumeMounts” under spec.containers.args and insert “volumes” under spec.
spec:
containers:
- args:
- ...
volumeMounts:
- mountPath: /etc/localtime
name: tz-config volumes:
- hostPath:
path: /usr/share/zoneinfo/Asia/Bangkok
type: ""
name: tz-config
Done
Edit1:
— if volumeMounts or volumes tag already exist, insert under it.