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

WIP: Add cronjob timezone #102889

Closed
wants to merge 4 commits into from
Closed

Conversation

iterion
Copy link
Contributor

@iterion iterion commented Jun 15, 2021

What type of PR is this?

/kind feature
/kind api-change

What this PR does / why we need it:

This PR adds a new field to the CronJobSpec named TimeZone that allows users to choose the specific time zone to use when scheduling jobs. If not specified, the previous default behavior of using the local time for the kube-controller-manager is preserved.

The ability to specify time zones is useful for Kubernetes users in situations where application requirements necessitate running jobs in specific time zones. In situations where users don't have control over the control plane local time, this also allows users to choose a time zone that is consistent and known to them.

Which issue(s) this PR fixes:

Fixes #47202

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Added the ability to specify TimeZone as part of the CronJobSpec. 
This allows the end-user to specify the time zone to be used when determining when to run a CronJob. If not specified, the time zone will continue to default to the same used by the kube-controller-manager.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/19-Graduate-CronJob-to-Stable#support-timezone-for-cronjobs

@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. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 15, 2021
@k8s-ci-robot
Copy link
Contributor

@iterion: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 15, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @iterion. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 15, 2021
@fedebongio
Copy link
Contributor

/remove-sig api-machinery
(looks like it's sig apps)

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jun 15, 2021
// The time zone to be used when scheduling the job given the schedule specified above.
// Valid options include anything in the IANA Time Zone database.
// +optional
TimeZone string
Copy link
Member

Choose a reason for hiding this comment

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

should be *string for it to be optional

// The time zone to be used when scheduling the job given the schedule specified above.
// Valid options include anything in the IANA Time Zone database.
// +optional
TimeZone string `json:"timeZone,omitempty" protobuf:"bytes,8,opt,name=timeZone"`
Copy link
Member

Choose a reason for hiding this comment

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

same

@dims
Copy link
Member

dims commented Jun 15, 2021

cc @soltysh @alaypatel07

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jun 15, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: iterion
To complete the pull request process, please assign smarterclayton after the PR has been reviewed.
You can assign the PR to them by writing /assign @smarterclayton in a comment when ready.

The full list of commands accepted by this bot can be found 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

@fedebongio
Copy link
Contributor

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jun 17, 2021
@soltysh
Copy link
Contributor

soltysh commented Jul 6, 2021

/hold
Thank you very much for your contribution, but before accepting this we'll need to revisit the decision stated in #47202 (comment) We need full support both from SIG-Apps and SIG-Architecture followed by KEP to be able to accept it.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 6, 2021
@iterion
Copy link
Contributor Author

iterion commented Jul 6, 2021

Instead of putting this in Kubernetes the ask is to:

  • Develop this in the ecosystem (e.g., a controller) that others can use. Distribute it, solve the problems there, and see what update looks like
  • If the solution is widely adopted and can be used by everyone (including small scale, multi-cluster, etc) then it could be considered for core Kubernetes

It seems like the ask has been satisfied, but maybe we need clearer criteria? How do we move this forward?

I'm happy to help out with a KEP, and to advocate for this, but I'm not sure where to start.

@k8s-ci-robot
Copy link
Contributor

@iterion: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 7, 2021
@soltysh
Copy link
Contributor

soltysh commented Jul 8, 2021

It seems like the ask has been satisfied, but maybe we need clearer criteria? How do we move this forward?

I'm happy to help out with a KEP, and to advocate for this, but I'm not sure where to start.

Start with presenting the idea to sig-apps at one of our next meetings. We can make the initial decision there and we can get the final approval from sig-architecture after that. If you're willing to write down the KEP we can easily plan this for 1.23.

@soltysh
Copy link
Contributor

soltysh commented Jul 8, 2021

Feel free to ping me on slack and I can get you pointed and setup where needed.

@soltysh
Copy link
Contributor

soltysh commented Jul 14, 2021

@iterion do you think you could make the next sig-apps call on July 26th to talk about this?

@iterion
Copy link
Contributor Author

iterion commented Jul 23, 2021

@soltysh sorry for the delay. I should be able to make it on July 26, what time does the meeting happen? My calendar is open for much of the day.

@soltysh
Copy link
Contributor

soltysh commented Jul 26, 2021

@soltysh sorry for the delay. I should be able to make it on July 26, what time does the meeting happen? My calendar is open for much of the day.

@iterion it's 9am pacific

@iterion
Copy link
Contributor Author

iterion commented Jul 26, 2021

Cool, I'm available to attend.

@mtparet
Copy link

mtparet commented Aug 3, 2021

@iterion Thank you so much. Most of k8s users are waiting this feature, thanks again caring about us !

@cndoit18
Copy link
Member

Hello, the current cronjob already supports timezone handling.
see: #104404

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 16, 2021
@benlangfeld
Copy link

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 17, 2021
@dims
Copy link
Member

dims commented Jan 14, 2022

/close

@k8s-ci-robot
Copy link
Contributor

@dims: Closed this PR.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dims
Copy link
Member

dims commented Jan 14, 2022

please reopen if you still need this WIP PR. Trying to declutter the open PR(s)

@nitaigao
Copy link

nitaigao commented Mar 21, 2022

The previous method using CRON_TZ= is being flagged as unsupported, can this be reopened?

See #104404

@cbandy
Copy link
Contributor

cbandy commented Mar 21, 2022

See #47202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CronJobs should support timezones