Change nginx-ingress localtime

Jbn1233
1 min readApr 19, 2020

--

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.

--

--

Jbn1233
Jbn1233

Written by Jbn1233

Very short and simple notes for CKA/SRE and may not works on your environment | jbn1233@gmail.com | Bangkok, Thailand |

No responses yet