-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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 labels, annotations and taints for JobSet #47383
base: main
Are you sure you want to change the base?
Document labels, annotations and taints for JobSet #47383
Conversation
Hi @sftim ,could you review on these changes if anythings need to change let me know . |
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
Used on: Jobs, Pods | ||
|
||
This label is used to store the name of the JobSet to which a job or pod belongs. |
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 label is used to store the name of the JobSet to which a job or pod belongs. | |
This label is used to store the name of the JobSet to which a Job or Pod belongs. | |
JobSet is an extension API that you can deploy into your Kubernetes cluster. |
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 have done this change as suggested.
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.
Thanks for working on this @kannon92, I added a couple comments
@Adarsh-verma-14 is the one who worked on this. |
Type: Annotation | ||
|
||
Example: `alpha.jobset.sigs.k8s.io/no-schedule: "true"` | ||
|
||
Used on: Jobs | ||
|
||
This annotation prevents the job from being scheduled. |
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.
Type: Annotation | |
Example: `alpha.jobset.sigs.k8s.io/no-schedule: "true"` | |
Used on: Jobs | |
This annotation prevents the job from being scheduled. | |
Type: Taint | |
Example: `alpha.jobset.sigs.k8s.io/no-schedule: NoSchedule` | |
Used on: Nodes | |
The JobSet controller uses this taint to support its node labeling exclusive placement strategy. | |
JobSet is an extension API that you can deploy into your Kubernetes cluster. |
(aside: I'd rename this to jobset.sigs.k8s.io/exclusive-use
or jobset.kubernetes.io/exclusive-use
)
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 have done this changes but is there need to change name (jobset.sigs.k8s.io/exclusive-use or jobset.kubernetes.io/exclusive-use) let me know.
There is also one taint, so: /retitle Document labels, annotations and taints for JobSet |
/sig apps |
Woops, sorry about that @Adarsh-verma-14! Thanks for the contribution :) |
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.
Very nearly LGTM for docs
|
||
Used on: JobSets | ||
|
||
This annotation acts as a flag. When set, the JobSet controller injects nodeSelectors for the `JobSetNameKey` label (e.g., `jobset.sigs.k8s.io/jobset-name`) to ensure exclusive job placement per topology. |
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 we could tidy the explanation here.
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 annotation acts as a flag. When it's set, the JobSet controller adds nodeSelectors for the JobSetNameKey
label (like jobset.sigs.k8s.io/jobset-name
), so jobs are placed according to a specific topology.
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.
@sftim it would be better or not ?
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.
What does the JobSet controller mutate based on this annotation?
- JobSets
- Jobs
- Pods
?
It's not clear.
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.
got it your point @sftim , I will update this accordingly.
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 have update this accordingly. Now, i think is clear. PTAL!!
Sorry, I'm against this change because
|
Thanks for the comment @tengqm, but JobSet is part of the Kubernetes project. I don't think we should force SIG Apps to reorganize a long page just to register their labels and annotations, even if that work is a good idea for the long term. |
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.
Looks good, just a couple more small changes
|
||
Used on: Jobs, Pods | ||
|
||
This label/annotation is used to store the name of the JobSet to which a Job or Pod belongs. |
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 label/annotation is used to store the name of the JobSet to which a Job or Pod belongs. | |
This label/annotation is used to store the name of the JobSet that a Job or Pod belongs to. |
/lgtm for JobSet @sftim this is ready for SIG docs 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.
There's no API kind called ReplicatedJob, right?
If that's true, try these changes. We main use the UpperCamelCase notation for actual API kinds.
/lgtm cancel
|
||
Used on: Jobs, Pods | ||
|
||
This label/annotation is set by the JobSet controller on child Jobs and Pods of a JobSet. The value will be the SHA256 hash of the namespaced Job name. |
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 label/annotation is set by the JobSet controller on child Jobs and Pods of a JobSet. The value will be the SHA256 hash of the namespaced Job name. | |
The JobSet controller sets this label (and also an annotation with the same key) on child Jobs and | |
Pods of a JobSet. The value is the SHA256 hash of the namespaced Job name. |
@Adarsh-verma-14 can you address sftim@'s comments as soon as you can please? The JobSet blog post PR is blocked by this one, so we are hoping to get it merged as soon as possible :) |
sure |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Hi , I have updated these changes as suggested by @sftim . PTAL!! |
Friendly ping @sftim |
|
||
Example: `jobset.sigs.k8s.io/replicatedjob-replicas: "5"` | ||
|
||
Used on: ReplicatedJobs |
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.
Is there definitely an API kind named ReplicatedJob? If so, what API group would I find this in?
|
||
Example: `alpha.jobset.sigs.k8s.io/exclusive-topology: "zone"` | ||
|
||
Used on: JobSets, ReplicatedJobs |
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.
Is there definitely an API kind named ReplicatedJob? If so, what API group would I find this in?
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.
There is no API kind named ReplicatedJob, but the annotation can be used on the JobTemplate defined inside the ReplicatedJob struct
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.
OK, so Used on:
would be JobSet, Job I think.
JobTemplate is also not an API kind (unlike say the unusual case of PodTemplate)
|
||
Type: Label, Annotation | ||
|
||
Example: `alpha.jobset.sigs.k8s.io/node-selector-strategy=true` |
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.
Example: `alpha.jobset.sigs.k8s.io/node-selector-strategy=true` | |
Example: `alpha.jobset.sigs.k8s.io/node-selector-strategy: "true"` |
|
||
Type: Annotation, Label | ||
|
||
Example: `alpha.jobset.sigs.k8s.io/default_myjobset-replicatedjob-0` |
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.
There should be a value for the label.
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.
Example: `alpha.jobset.sigs.k8s.io/default_myjobset-replicatedjob-0` | |
Example: `alpha.jobset.sigs.k8s.io/namespaced-job: default_myjobset-replicatedjob-0` |
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.
As an aside, this will run into name length issues. The JobSet and Namespace can both have names that are up to 63 characters long, so the concatenation won't always fit into a label value.
(but not really relevant to this PR).
|
||
Type: Label, Annotation | ||
|
||
Example: `jobset.sigs.k8s.io/job-key=0f1e93893c4cb372080804ddb9153093cb0d20cefdd37f653e739c232d363feb` |
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.
Example: `jobset.sigs.k8s.io/job-key=0f1e93893c4cb372080804ddb9153093cb0d20cefdd37f653e739c232d363feb` | |
Example: `jobset.sigs.k8s.io/job-key: 0f1e93893c4cb372080804ddb9153093cb0d20cefdd37f653e739c232d363feb` |
This doesn't look right. Is 0f1e93893c4cb372080804ddb9153093cb0d20cefdd37f653e739c232d363feb
definitely a valid label value? It looks longer than is allowed.
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.
It is, we set the value as the SHA256 hash of the namespaced job name here.
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.
OK, but a SHA256 hash is 64 UTF-8 (or ASCII) characters, and conformant label values are documented as being up to 63 characters long.
Something doesn't add up. Maybe there's an off-by-one in the API server (I hope not).
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.
Sorry, it's SHA1 not SHA256, my mistake. So it's only 40 characters.
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.
OK. Minor docs bug then; we can merge this with or without a fix (still would need a post-merge fixup).
|
||
Used on: Jobs, Pods | ||
|
||
This label/annotation is set by the JobSet controller on child Jobs and Pods. It contains the index of the Job replica within its parent ReplicatedJob. |
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.
Is there definitely an API kind named ReplicatedJob? If so, what API group would I find this in?
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.
There's no ReplicatedJob API, it is just part of the JobSet API: https://github.com/kubernetes-sigs/jobset/blob/b92cbdcbe77f168a82cf12c9f349bdd053d2ae5c/api/jobset/v1alpha2/jobset_types.go#L85
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.
OK, this needs fixing.
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.
We mainly just want to document what's there even if it's a bit awry. This is close but not yet right, though, and I think it does need another round of corrections.
@Adarsh-verma-14 can you address the last few comments here? Thanks! |
Hello, anything blocking this one? |
There's a lot of pending feedback. I noticed #47383 (comment) |
since @Adarsh-verma-14 is not responding, I will clone it and submit a PR tomorrow to close this |
sorry for late response, due to some engagement with my other work. it will take more time meanwhile if anyone wants to work on it, can work. |
I created #49217 |
Adding labels and annotation for JobSet in https://github.com/kubernetes/website/blob/main/content/en/docs/reference/labels-annotations-taints/_index.md
Fixes #47373
/language en