Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document timezone support for CronJob #32577

Merged
merged 1 commit into from Apr 1, 2022

Conversation

deejross
Copy link
Contributor

@deejross deejross commented Mar 28, 2022

@k8s-ci-robot k8s-ci-robot added this to the 1.24 milestone Mar 28, 2022
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 28, 2022
@netlify
Copy link

netlify bot commented Mar 28, 2022

👷 Deploy Preview for kubernetes-io-vnext-staging processing.

Name Link
🔨 Latest commit e80bed6
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/62449723ff76ee000907a26b

@k8s-ci-robot
Copy link
Contributor

Welcome @deejross!

It looks like this is your first PR to kubernetes/website 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/website has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels Mar 28, 2022
@mehabhalodiya
Copy link
Contributor

/assign

@mehabhalodiya
Copy link
Contributor

/sig apps

@k8s-ci-robot k8s-ci-robot added the sig/apps Categorizes an issue or PR as relevant to SIG Apps. label Mar 29, 2022
@sftim
Copy link
Contributor

sftim commented Mar 29, 2022

/retitle Document timezone support for CronJob

@k8s-ci-robot k8s-ci-robot changed the title KEP 3140 Document timezone support for CronJob Mar 29, 2022
@soltysh
Copy link
Contributor

soltysh commented Mar 29, 2022

/assign

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 30, 2022
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. Here's some early feedback that I hope is useful.

@@ -36,6 +36,8 @@ for parsing and calculating the next Job creation time. Any usage of it is not
recommended in a production cluster.
{{< /caution >}}

**ALPHA**: CronJob now supports a new `timeZone` field and requires the `CronJobTimeZone` featuregate to be enabled to use.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can omit this.

Comment on lines 96 to 106
## TimeZone Support
**ALPHA** as of 1.24

There is now a new `timeZone` field and requires the `CronJobTimeZone` featuregate to be enabled to use. It is an optional field that should be set either to nil or a non-empty string. The `timeZone` string value should be a valid time zone name. Please see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, the local time zone of kube-controller-manager is used.

An external time zone database should be available for use. In the event that one is not available, one from the Go standard library will be embedded into the binaries.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd write it like this:

Suggested change
## TimeZone Support
**ALPHA** as of 1.24
There is now a new `timeZone` field and requires the `CronJobTimeZone` featuregate to be enabled to use. It is an optional field that should be set either to nil or a non-empty string. The `timeZone` string value should be a valid time zone name. Please see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, the local time zone of kube-controller-manager is used.
An external time zone database should be available for use. In the event that one is not available, one from the Go standard library will be embedded into the binaries.
## Time zones
For CronJobs with no time zone specified, the kube-controller-manager interprets schedules relative to its local time zone.
{{< feature-state for_k8s_version="v1.24" state="alpha" >}}
If you enable the `CronJobTimeZone` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/),
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
Kubernetes that does not have experimental time zone support, all CronJobs in your cluster have an unspecified
timezone).
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) name. For example, setting
`spec.timezone: "Etc/UTC"` instructs Kubernetes to interpret the schedule relative to Coordinated Universal Time.

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, rest lgtm


There is now a new `timeZone` field and requires the `CronJobTimeZone` featuregate to be enabled to use. It is an optional field that should be set either to nil or a non-empty string. The `timeZone` string value should be a valid time zone name. Please see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, the local time zone of kube-controller-manager is used.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
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.

@deejross deejross marked this pull request as ready for review March 30, 2022 14:02
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 30, 2022
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown and text mostly LGTM, one nit.

@tengqm
Copy link
Contributor

tengqm commented Apr 1, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 1, 2022
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 209f5d90dca4bb69eb2a21df1057e8ce8ff83a87

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sftim, soltysh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 1, 2022
@k8s-ci-robot k8s-ci-robot merged commit dce29be into kubernetes:dev-1.24 Apr 1, 2022
@deejross deejross deleted the kep3140 branch April 1, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants