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

make Kubelet bootstrap certificate signal aware #92786

Conversation

answer1991
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

When I work on #92727, I found Kubelet is not signal aware when bootstrapping certificate. Which means we can only use twice signal to kill Kubelet(through os.Exit(1)) when the certificate bootstrap is in progress. However, when kube-controller-manager or connection to kube-apiserver has some problem, the progress of certificate bootstrap may take a little long time.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Add a new function SetupSignalContext which is similar to SetupSignalHandler, but returned is context.Context. context.Context is more standard than stop chan(<-chan struct{}) as a parameter to call an async or long-term function, and I found same new function receive context.Context rather than <-chan struct{}. It's easy to get <-chan struct{} from context.Context(use Context.Done()), but it's not easy to build context.Context from <-chan struct{}(may cost an new goroutine).

Does this PR introduce a user-facing change?:

make Kubelet bootstrap certificate signal aware

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 4, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @answer1991. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added area/apiserver area/kubelet sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 4, 2020
@answer1991 answer1991 force-pushed the feature/enhance-bootstrap-certificate branch from 0f2b51d to 042c379 Compare July 4, 2020 04:57
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 4, 2020
@answer1991
Copy link
Contributor Author

/sig node
/ok-to-test
/assign @liggitt

@k8s-ci-robot
Copy link
Contributor

@answer1991: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/sig node
/ok-to-test
/assign @liggitt

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.

@alejandrox1
Copy link
Contributor

@answer1991 you have to be an org member to apply an "ok-to-test" label
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 4, 2020
@answer1991 answer1991 force-pushed the feature/enhance-bootstrap-certificate branch from 042c379 to 05bf028 Compare July 5, 2020 04:17
@answer1991
Copy link
Contributor Author

@alejandrox1 thanks

@answer1991
Copy link
Contributor Author

/retest

1 similar comment
@answer1991
Copy link
Contributor Author

/retest

@liggitt
Copy link
Member

liggitt commented Jul 6, 2020

/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 Jul 6, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: answer1991, liggitt

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 Jul 6, 2020
@answer1991
Copy link
Contributor Author

/test pull-kubernetes-conformance-kind-ga-only-parallel

@k8s-ci-robot k8s-ci-robot merged commit a26e588 into kubernetes:master Jul 6, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jul 6, 2020
@answer1991 answer1991 deleted the feature/enhance-bootstrap-certificate branch July 6, 2020 17:00
@fedebongio
Copy link
Contributor

Thank you Jordan for taking a look!

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/apiserver area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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/auth Categorizes an issue or PR as relevant to SIG Auth. sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants