<p>I want to schedule kubernetes cronjob in my local timezone (GMT+7), currently when I schedule cronjob in k8s I need to schedule in UTC but I want to schedule in my local timezone, As specify in <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="noreferrer">Kubernetes document</a>, that I need to change timezone in kube-controller manager as follows</p>
<blockquote>
<p>All CronJob schedule: times are based on the timezone of the
kube-controller-manager.</p>
<p>If your control plane runs the kube-controller-manager in Pods or bare
containers, the timezone set for the kube-controller-manager container
determines the timezone that the cron job controller uses.</p>
</blockquote>
<p>But I can't find a way to set timezone for kube-controller-manager, I'm using Kuberenetes on-premise v1.17, I found controller manager manifest file in - /etc/kubernetes/manifests/kube-controller-manager.yaml but can't find a way to or document to change the it's timezone.</p>

<p>UPDATE 2023: WARNING OLD SYNTAX.  See @Thanawat's answer, the official syntax has changed from what is shown in this answer.</p>
<hr />
<pre class="lang-yaml prettyprint-override"><code>spec:
  schedule: &quot;CRON_TZ=America/New_York */5 * * * *&quot;
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>spec:
  schedule: &quot;CRON_TZ=Etc/UTC */5 * * * *&quot;
</code></pre>
<p>By an <em>&quot;accident of implementation&quot;</em> timezone support was added to kubernetes cron scheduler.</p>
<p>available in v1.22 (next release)<br />
Note: v1.22 should be released by end-of-year, Oct/Nov 2021</p>
<ul>
<li><a href="https://github.com/kubernetes/kubernetes/issues/47202#issuecomment-901294870" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/47202#issuecomment-901294870</a>
<ul>
<li>warning: very long issue thread</li>
</ul>
</li>
<li>mentioned in <a href="https://kubernetespodcast.com/episode/160-keda/" rel="nofollow noreferrer">https://kubernetespodcast.com/episode/160-keda/</a></li>
<li>this accidental feature snuck in when a dependency was updated</li>
<li>warning: not entirely clear if k8s maintainers might remove/block this feature instead of supporting it
<ul>
<li>unit tests to cover the new user-facing feature have not yet been merged as of 2021-08-31: <a href="https://github.com/kubernetes/kubernetes/pull/104404" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/pull/104404</a></li>
<li>static TZ or daylight savings schedule is one thing, but TZ and DST schedules change over time</li>
</ul>
</li>
</ul>
