-
Notifications
You must be signed in to change notification settings - Fork 283
feat(nodepool): support timezone for disruption budgets #2032
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
base: main
Are you sure you want to change the base?
feat(nodepool): support timezone for disruption budgets #2032
Conversation
Hi @flavono123. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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-sigs/prow repository. |
are we have to emit a new event for a wrong timezone?:
https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/cron-job-v1/#CronJobSpec |
Pull Request Test Coverage Report for Build 15434332727Details
💛 - Coveralls |
@njtran could you mind to review this? |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: flavono123 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 |
@flavono123 Would you mind coming to one of our Working Group meetings and we can discuss this one more? I think there are some tricky things with handling timezones that we have generally avoided but open to talk more about your use-case. |
@jonathan-innis thanks for inviting me. i'd like to, but two things are hurdles for me:
so let me explain my use-case in "text", in advance: - duration: 21h
nodes: "0"
schedule: 0 21 * * sun-thu I use budgets like the one above to allow disruptions from 3am to 6am, Monday to Friday in KST(actually, leveraging does not allow from 6am to 3am tomorrow to avoid working time). I think it is more confusing when the duration is over the date and with weekdays for my case. In short, this is just a literal time zone issue to make it easier to figure out the time span of budgets. |
/assign @elmiko |
putting this in my queue for the week, my intention is to review the various places where a time value is used and enumerate them in a doc. then we can review the doc to see if we should update all the time uses to include a user-specified timezone. |
i poked around the karpenter code this week and i think we can confirm the the if we wanted to support timezones for disruption budgets, i think we would want to add a |
@elmiko It looks like the PR now supports your suggestion about using a separate timeZone field in the budgets section -- is this PR ready for another round of review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is looking good to me
pkg/apis/v1/nodepool_budgets_test.go
Outdated
@@ -237,6 +235,29 @@ var _ = Describe("Budgets", func() { | |||
Expect(err).To(Succeed()) | |||
Expect(active).To(BeFalse()) | |||
}) | |||
It("should reutn that a schedule is active with a timezone", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: reutn -> return :)
Signed-off-by: flavono123 <[email protected]>
Signed-off-by: flavono123 <[email protected]>
63523ea
to
c8baa62
Compare
Fixes #1446, partially
Description
add the field
disruption.budgets[].timeZone
for NodePoolSpec.if not set, use UTC as default.
validate if not schedule is set, timeZone also cannot be.
referenced one in CronJobSpec and already tried PR #1447
How was this change tested?
make verify && go test ./pkg/apis/v1/
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.