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
Support for the Job managedBy field (alpha) #123273
Conversation
/cc @alculquicondor |
Changelog suggestion -Add support for the Job managed-by label in Beta
+Added more labelling for Pods that belong to a Job. The Pods are labelled with the key `batch.kubernetes.io/managed-by`
+provided that the feature gate `JobManagedByLabel` is enabled for the cluster. The label value is `job-controller.k8s.io`
+for Pods managed by a Job. (if that's not right, please correct the text to tell the actual story) |
9937612
to
ef74f41
Compare
Thanks for pointing out there is a need to clarify this. Let me know if the new note makes it clear, I'm happy to adjust / clarify more. |
1b0ef21
to
9497308
Compare
Further changelog suggestion -Add support for the Job's "batch.kubernetes.io/managed-by" label in Beta. Jobs with a custom value of this
-label (other than "job-controller.k8s.io") are skipped by the Job controller, and their reconciliation is
+Added (beta) support for the `batch.kubernetes.io/managed-by` label on Jobs. Jobs with a custom value of this
+label - any label value other than `job-controller.k8s.io` - are skipped by the job controller, and their reconciliation is
-delegated to an external controller, indicated by the value of the label. Jobs without this label, or with
-the reserved "job-controller.k8s.io" as value, are reconciled by the built-in Job controller.
+delegated to an external controller, indicated by the value of the label. Jobs that don't have this label at all,
+or where the label value is the reserved string `job-controller.k8s.io` as value, are reconciled by the built-in
+job controller. This is [a fragment of] Markdown, so use backticks rather than double quotes. Also no capitals in “job controller”. |
lgtm, thanks, applied |
D'oh, my error; one more suggested update. Added (beta) support for the `batch.kubernetes.io/managed-by` label on Jobs. Jobs with a custom value of this
label - any label value other than `job-controller.k8s.io` - are skipped by the job controller, and their reconciliation is
delegated to an external controller, indicated by the value of the label. Jobs that don't have this label at all,
-or where the label value is the reserved string `job-controller.k8s.io` as value, are reconciled by the built-in
+or where the label value is the reserved string `job-controller.k8s.io`, are reconciled by the built-in
job controller. |
9497308
to
6d86701
Compare
67d2808
to
3b8d643
Compare
3b8d643
to
00a8b4e
Compare
/retest |
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.
/approve cancel
to skip updating the pod metrics for finalized pods.
Same response as here: #123273 (comment). I'm afraid that making the distinction is likely to introduce bugs. For example, the metic is guage. We may not increment because there is a custom managedBy, but then we would decrement the metric on pod removal (becuase there is already no parent, so we cannot check). This could make the metric skewed, like getting too early to 0. |
/retest |
/approve |
/retest |
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.
/lgtm
/label tide/merge-method-squash
LGTM label has been added. Git tree hash: a1e9e235b583a9b058118835617e84fd5b6d06d4
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, deads2k, mimowo, 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 |
/hold cancel |
/test pull-kubernetes-e2e-kind-ipv6 |
* support for the managed-by label in Job * Use managedBy field instead of managed-by label * Additional review remarks * Review remarks 2 * review remarks 3 * Skip cleanup of finalizers for job with custom managedBy * Drop the performance optimization * imrpove logs
* support for the managed-by label in Job * Use managedBy field instead of managed-by label * Additional review remarks * Review remarks 2 * review remarks 3 * Skip cleanup of finalizers for job with custom managedBy * Drop the performance optimization * imrpove logs
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
In order to support a mechanism allowing to delegate reconciliation of a Job to an external controller. See more details in the KEP.
Which issue(s) this PR fixes:
Part of enhancement tracking issue: kubernetes/enhancements#4368
Special notes for your reviewer:
After discussion with API reviewers we decided to use field instead of label, see here.
This means the feature will go into Alpha for 1.30. Here is the relevant KEP update.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: