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

Track ready pods in Job status #104915

Merged
merged 3 commits into from Oct 28, 2021
Merged

Conversation

alculquicondor
Copy link
Member

@alculquicondor alculquicondor commented Sep 10, 2021

What type of PR is this?

/kind feature
/kind api-change
/sig apps

What this PR does / why we need it:

Add field .status.ready to track the number of ready pods in a Job.

The feature is guarded by feature gate JobReadyPods. To reduce the number of Job status updates that this new tracking might cause, Pod updates are batched in intervals of 0.5s.

Which issue(s) this PR fixes:

Ref kubernetes/enhancements#2879

Special notes for your reviewer:

First commit has the API changes.

I couldn't find a significant difference in the runtime of the integration tests between different batch periods. I'm leaving this at 0.5s to be conservative. We can reconsider when going to beta.

Does this PR introduce a user-facing change?

Track the number of Pods with a Ready condition in Job status. The feature is alpha and needs the feature gate JobReadyPods to be enabled.

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

- [KEP]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/2879-ready-pods-job-status

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/apps Categorizes an issue or PR as relevant to SIG Apps. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 10, 2021
@k8s-ci-robot k8s-ci-robot added area/kubectl area/test sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Sep 10, 2021
@fedebongio
Copy link
Contributor

Consensus that this is mostly sig apps
/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Sep 14, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 22, 2021
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 5, 2021
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 7, 2021
@alculquicondor
Copy link
Member Author

/assign @soltysh

@alculquicondor
Copy link
Member Author

/label api-review

/remove-sig api-machinery

@liggitt liggitt moved this from In progress to Changes requested in API Reviews Oct 14, 2021
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 15, 2021
Copy link
Member Author

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

Also added validation for non-negative ready field.

pkg/apis/batch/types.go Outdated Show resolved Hide resolved
pkg/features/kube_features.go Outdated Show resolved Hide resolved
staging/src/k8s.io/kubectl/pkg/describe/describe.go Outdated Show resolved Hide resolved
staging/src/k8s.io/api/batch/v1/types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Oct 15, 2021
@alculquicondor
Copy link
Member Author

/retest

@liggitt
Copy link
Member

liggitt commented Oct 19, 2021

staging/src/k8s.io/api/testdata/v1.22.0/batch.v1.Job.after_roundtrip.pb shouldn't have a diff now that the field is a pointer

@liggitt
Copy link
Member

liggitt commented Oct 19, 2021

api changes lgtm (after staging/src/k8s.io/api/testdata/v1.22.0/batch.v1.Job.after_roundtrip.pb is reverted)

controller changes need lgtm from apps approver

@alculquicondor
Copy link
Member Author

Removed the roundtrip file

@liggitt
Copy link
Member

liggitt commented Oct 19, 2021

API changes lgtm

@liggitt liggitt moved this from Changes requested to API review completed, 1.23 in API Reviews Oct 19, 2021
@alculquicondor
Copy link
Member Author

/retest

1 similar comment
@alculquicondor
Copy link
Member Author

/retest

to keep a count of the pods that have the ready condition.

Also:
- Add feature gate JobReadyPods.
- Add Ready to describe.

Change-Id: Ib934730a430a8e2a2f485671e345fe2330006939
When the feature gate JobReadyPods is enabled.

Change-Id: I86f93914568de6a7029f9ae92ee7b749686fbf97
Change-Id: I1f20657f4f9cd4daad73149f969bad52a33698fa
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 28, 2021
@liggitt
Copy link
Member

liggitt commented Oct 28, 2021

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, liggitt, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 28, 2021
@k8s-ci-robot k8s-ci-robot merged commit 6edcb60 into kubernetes:master Oct 28, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubectl area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: API review completed, 1.23
Development

Successfully merging this pull request may close these issues.

None yet

6 participants