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

Introducing Sleep Action for PreStop Hook #119026

Merged
merged 5 commits into from Oct 16, 2023

Conversation

AxeZhan
Copy link
Member

@AxeZhan AxeZhan commented Jul 3, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

This is the implementation for kubernetes/enhancements#3960

Which issue(s) this PR fixes:

Fixes #114465

Special notes for your reviewer:

Does this PR introduce a user-facing change?

A new sleep action for the PreStop lifecycle hook is added, allowing containers to pause for a specified duration before termination.

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

detailed KEP: https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/3960-pod-lifecycle-sleep-action/README.md

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. 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 Jul 3, 2023
@k8s-ci-robot k8s-ci-robot added area/code-generation area/kubelet area/test kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 3, 2023
pkg/apis/core/validation/validation.go Outdated Show resolved Hide resolved
test/e2e/common/node/lifecycle_hook.go Outdated Show resolved Hide resolved
@AxeZhan
Copy link
Member Author

AxeZhan commented Jul 3, 2023

/cc @thockin for review and help first🙏

@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@SergeyKanzhelev SergeyKanzhelev moved this from Triage to Archive-it in SIG Node CI/Test Board Jul 5, 2023
@jiahuif
Copy link
Member

jiahuif commented Jul 6, 2023

/assign @thockin
For approval
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 6, 2023
@k8s-ci-robot k8s-ci-robot removed the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 11, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 15, 2023
@AxeZhan
Copy link
Member Author

AxeZhan commented Oct 15, 2023

fixed and rebased

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

Thanks!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 15, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: ec6af00916adc78a0e7207e01c3860b413e25be1

@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 15, 2023
@thockin
Copy link
Member

thockin commented Oct 15, 2023

Verify failure looks real.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 16, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AxeZhan, thockin

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
Copy link
Contributor

k8s-ci-robot commented Oct 16, 2023

@AxeZhan: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-linter-hints 5c0618b link false /test pull-kubernetes-linter-hints

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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/test-infra repository. I understand the commands that are listed here.

@AxeZhan
Copy link
Member Author

AxeZhan commented Oct 16, 2023

@thockin Need a new lgtm after generated codes are pushed.

@pacoxu
Copy link
Member

pacoxu commented Oct 16, 2023

/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 16, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 221a418cd4244e50d74a82ca0393807daddcf8ba

@pacoxu
Copy link
Member

pacoxu commented Oct 16, 2023

/skip

@k8s-ci-robot k8s-ci-robot merged commit f6ba25f into kubernetes:master Oct 16, 2023
16 checks passed
SIG Node PR Triage automation moved this from Needs Reviewer to Done Oct 16, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Oct 16, 2023
aojea added a commit to aojea/kubernetes that referenced this pull request Oct 18, 2023

Choose a reason for hiding this comment

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

Hi, Axe. Sorry to leave comment on your PR. I have a quick question would to ask for about how to generate this core/v1/generated.pb.go from go struct definition on K8S resource.

We have a use case that we define a CRD defined in go struct, and we need to generate the proto related methods for marshal/unmarshal. But we could not successfully generate them.

We are trying to use protoc-gen-gogo and go-to-protobuf, but could not make fully work.

Do you mind share what's the commands should be used to auto gen "core/v1/generated.proto" and "core/v1/generated.pb.go" files based on types.go file?

Really appreciate your help and answers.

Thanks

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm, not sure how CRD codes are generated, but you can refer to https://github.com/kubernetes/kubernetes/blob/master/hack/update-codegen.sh In tree structs use this to generate.

Choose a reason for hiding this comment

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

Thanks for your immediate answer. This code pointer is very useful and very promising. Let me take a look. Thanks

Choose a reason for hiding this comment

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

One more question, when you update k8s native resource, what script do you run to update the generated proto and pb.go? Did you just need to run "kubernetes/blob/master/hack/update-all.sh" script, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes:)

Choose a reason for hiding this comment

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

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/code-generation area/kubelet 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/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. 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/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

pod LifecycleHandler should support a sleep option