0

I am currently using emailing alerts for our application. One of the contents of the email is the start and end time of the alert but they are displaying as UTC+0000.

Tried using .Start.Local.Format but realized that the only time that alertmanager pod has it UTC+0000. Was wondering if there is a way I can set the pod timezone

markalex
  • 8,623
  • 2
  • 7
  • 32
CC28
  • 23
  • 3

1 Answers1

1

You can change the timezone of pods by using volumes and volumeMounts to specify the timezone, like :

volumeMounts:
    - name: tz-config
      mountPath: /etc/localtime
  volumes:
    - name: tz-config
      hostPath:
        path: /usr/share/zoneinfo/America/Chicago

Or you can use the "TZ" environment variable in the container section inside the pod spec, to configure the desired time zone:

spec:
 containers:
  - name:
  foo-bar
  image: foobar:latest
  imagePullPolicy: Always
  env:
   - name: TZ
   value: America/Chicago

This changes the timezone displayed by the pod, which you can confirm using "kubectl exec POD date".

The Default Dashboards Timezone is utc. Attaching the list of timezones for reference.

Sai Chandra Gadde
  • 2,242
  • 1
  • 3
  • 15