-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Scheduledjob api #24970
Scheduledjob api #24970
Conversation
The tests are failing apparently due to relying on older master. I'll rebase this PR once #21675 merges. |
e3ae080
to
ea5c8a4
Compare
Rebase was clean, so I did it. |
ea5c8a4
to
eb67f31
Compare
|
||
// Suspend flag tells the controller to suspend subsequent executions, it does | ||
// not apply to already started executions. Defaults to false. | ||
Suspend bool `json: "suspend"` |
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.
I like this field for other controllers too... is this the same idea as inert objects generally?
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.
I'm not familiar with the idea you've mentioned, can you point me to a doc? The idea of having a scheduledjob suspended came out during fleshing out the details for ScheduledJobs what it should allow. Basically in this world you can suspend further job that might start, until some later time, when eg. your server will be less busy or whatever else.
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.
i was interested in the idea of a replica set w/ size=0 supporting a similar suspend flag which would mean that controllers could effectively ignore it. I will look up the old discussion, but here was a similar concept: #170 (comment)
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.
I think I remember that concept, so no this is completely different idea. Some discussion wrt suspend you can find in the proposal PR: #11980
eb67f31
to
613f3e2
Compare
// ScheduledJobStatus represents the current state of a Job. | ||
type ScheduledJobStatus struct { | ||
// Active holds pointers to currently running jobs. | ||
Active []api.ObjectReference `json:"active,omitempty"` |
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.
Will there be something in the referenced job which identifies which execution it is from (in case of allowed concurrency?)
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 could be an annotation or it could be embedded in the generated name as a date code or something. No action needed here.
I've written what I think is a valid scheduledJob object: apiVersion: batch/v2alpha1
kind: ScheduledJob
metadata:
name: pi
spec:
schedule: "0 0 0 0 0"
startingDeadlineSeconds: 30
concurrencyPolicy: "Allow"
suspend: false
jobTemplate:
spec:
template:
spec:
containers:
- name: pi
image: perl
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
restartPolicy: Never |
TIL: when a controller like replicaSet creates a pod from a template, it (surprisingly) ignores |
I haven't thought about it earlier, but that's I guess the only reasonable pattern to follow. |
How is this going? |
2 weeks before code freeze. |
GCE e2e build/test passed for commit 22bada0. |
LGTM |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 22bada0. |
Automatic merge from submit-queue |
Automatic merge from submit-queue ScheduledJob client @erictune SheduledJob part 2, based on #24970 so first two commits doesn't count. This is still WIP, but it's here so you know :) ```release-note Introducing ScheduledJobs as described in [the proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/scheduledjob.md) as part of `batch/v2alpha1` version (experimental feature). ``` [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
@erictune ScheduledJob api types, based on #21675, so only last two commits counts.
@sdminonne fyi