Skip to content

Commit e2526aa

Browse files
authored
Merge pull request #39835 from soltysh/cronjob_tz_ga
Promote CronJobTimeZone to stable
2 parents f6a72d1 + b6b1fc3 commit e2526aa

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

content/en/docs/concepts/workloads/controllers/cron-jobs.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ weight: 80
1414

1515
A _CronJob_ creates {{< glossary_tooltip term_id="job" text="Jobs" >}} on a repeating schedule.
1616

17-
CronJob is meant for performing regular scheduled actions such as backups, report generation,
18-
and so on. One CronJob object is like one line of a _crontab_ (cron table) file on a
19-
Unix system. It runs a job periodically on a given schedule, written in
17+
CronJob is meant for performing regular scheduled actions such as backups, report generation,
18+
and so on. One CronJob object is like one line of a _crontab_ (cron table) file on a
19+
Unix system. It runs a job periodically on a given schedule, written in
2020
[Cron](https://en.wikipedia.org/wiki/Cron) format.
2121

2222
CronJobs have limitations and idiosyncrasies.
@@ -162,19 +162,22 @@ For another way to clean up jobs automatically, see [Clean up finished jobs auto
162162

163163
### Time zones
164164

165-
For CronJobs with no time zone specified, the {{< glossary_tooltip term_id="kube-controller-manager" text="kube-controller-manager" >}} interprets schedules relative to its local time zone.
165+
{{< feature-state for_k8s_version="v1.27" state="stable" >}}
166166

167-
{{< feature-state for_k8s_version="v1.25" state="beta" >}}
167+
For CronJobs with no time zone specified, the {{< glossary_tooltip term_id="kube-controller-manager" text="kube-controller-manager" >}}
168+
interprets schedules relative to its local time zone.
168169

169-
If you enable the `CronJobTimeZone` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/),
170-
you can specify a time zone for a CronJob (if you don't enable that feature gate, or if you are using a version of
171-
Kubernetes that does not have experimental time zone support, all CronJobs in your cluster have an unspecified
172-
timezone).
170+
You can specify a time zone for a CronJob by setting `.spec.timeZone` to the name
171+
of a valid [time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
172+
For example, setting `.spec.timeZone: "Etc/UTC"` instructs Kubernetes to interpret
173+
the schedule relative to Coordinated Universal Time.
173174

174-
When you have the feature enabled, you can set `.spec.timeZone` to the name of a valid [time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For example, setting
175-
`.spec.timeZone: "Etc/UTC"` instructs Kubernetes to interpret the schedule relative to Coordinated Universal Time.
175+
A time zone database from the Go standard library is included in the binaries and used as a fallback in case an external database is not available on the system.
176+
177+
## CronJob limitations {#cron-job-limitations}
178+
179+
### Unsupported TimeZone specification
176180

177-
{{< caution >}}
178181
The implementation of the CronJob API in Kubernetes {{< skew currentVersion >}} lets you set
179182
the `.spec.schedule` field to include a timezone; for example: `CRON_TZ=UTC * * * * *`
180183
or `TZ=UTC * * * * *`.
@@ -183,14 +186,10 @@ Specifying a timezone that way is **not officially supported** (and never has be
183186

184187
If you try to set a schedule that includes `TZ` or `CRON_TZ` timezone specification,
185188
Kubernetes reports a [warning](/blog/2020/09/03/warnings/) to the client.
186-
Future versions of Kubernetes might not implement that unofficial timezone mechanism at all.
187-
{{< /caution >}}
188-
189-
A time zone database from the Go standard library is included in the binaries and used as a fallback in case an external database is not available on the system.
190-
191-
## CronJob limitations {#cron-job-limitations}
189+
Future versions of Kubernetes will prevent setting the unofficial timezone mechanism entirely.
192190

193191
### Modifying a CronJob
192+
194193
By design, a CronJob contains a template for _new_ Jobs.
195194
If you modify an existing CronJob, the changes you make will apply to new Jobs that
196195
start to run after your modification is complete. Jobs (and their Pods) that have already

content/en/docs/reference/command-line-tools-reference/feature-gates.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ For a reference to old feature gates that are removed, please refer to
8282
| `ComponentSLIs` | `false` | Alpha | 1.26 | |
8383
| `ContainerCheckpoint` | `false` | Alpha | 1.25 | |
8484
| `ContextualLogging` | `false` | Alpha | 1.24 | |
85-
| `CronJobTimeZone` | `false` | Alpha | 1.24 | 1.24 |
86-
| `CronJobTimeZone` | `true` | Beta | 1.25 | |
8785
| `CrossNamespaceVolumeDataSource` | `false` | Alpha| 1.26 | |
8886
| `CustomCPUCFSQuotaPeriod` | `false` | Alpha | 1.12 | |
8987
| `CustomResourceValidationExpressions` | `false` | Alpha | 1.23 | 1.24 |
@@ -254,6 +252,9 @@ For a reference to old feature gates that are removed, please refer to
254252
| `CSIStorageCapacity` | `true` | Beta | 1.21 | 1.23 |
255253
| `CSIStorageCapacity` | `true` | GA | 1.24 | - |
256254
| `ConsistentHTTPGetHandlers` | `true` | GA | 1.25 | - |
255+
| `CronJobTimeZone` | `false` | Alpha | 1.24 | 1.24 |
256+
| `CronJobTimeZone` | `true` | Beta | 1.25 | 1.26 |
257+
| `CronJobTimeZone` | `true` | GA | 1.27 | - |
257258
| `DaemonSetUpdateSurge` | `false` | Alpha | 1.21 | 1.21 |
258259
| `DaemonSetUpdateSurge` | `true` | Beta | 1.22 | 1.24 |
259260
| `DaemonSetUpdateSurge` | `true` | GA | 1.25 | - |

0 commit comments

Comments
 (0)