vSphere IaaS support of CRON_TZ and TZ variables in cronjob spec.schedule
search cancel

vSphere IaaS support of CRON_TZ and TZ variables in cronjob spec.schedule

book

Article ID: 372449

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

A customer may want to specify a timezone or run a cronjob in a specific timezone.

The "Cronjob" documentation from kubernetes.io states, "Specifying a timezone using CRON_TZ or TZ variables inside .spec.schedule is not officially supported (and never has been). Starting with Kubernetes 1.29 if you try to set a schedule that includes TZ or CRON_TZ timezone specification, Kubernetes will fail to create the resource with a validation error. Updates to CronJobs already using TZ or CRON_TZ will continue to report a warning to the client" (https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#cron-job-limitations).

Environment

All Tanzu Kubernetes Releases.

Cause

Specifying a timezone for cronjobs is not supported in upstream Kubernetes.

Resolution

Use UTC timezone.