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

Dynamic serving certificates #84200

Merged
merged 2 commits into from Oct 24, 2019

Conversation

@jackkleeman
Copy link
Member

jackkleeman commented Oct 22, 2019

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR means that apiserver serving certificates are reloaded off of disk every minute, and notify the dynamic certificate controller when they change, leading to an updated tls.Config being served. SNI certs will be handled in a later PR

Which issue(s) this PR fixes:
Fixes #66448

Does this PR introduce a user-facing change?:

Reload apiserver serving certificate from disk every minute
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Oct 22, 2019

Hi @jackkleeman. 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.

@jackkleeman

This comment has been minimized.

Copy link
Member Author

jackkleeman commented Oct 22, 2019

/assign @deads2k

}

// check to see if we have a change. If the values are the same, do nothing.
existing, ok := c.caBundle.Load().(*certKeyContent)

This comment has been minimized.

Copy link
@sttts

sttts Oct 23, 2019

Contributor

as in the other pull. Why doesn't this panic when nil is stored?

This comment has been minimized.

Copy link
@sttts

This comment has been minimized.

Copy link
@jackkleeman

jackkleeman Oct 23, 2019

Author Member

It shouldn't because of the ok, I thought?

This comment has been minimized.

@jackkleeman jackkleeman force-pushed the jackkleeman:dynamic-serving-cert branch from a7b9e87 to cc90aba Oct 23, 2019
@k8s-ci-robot k8s-ci-robot added size/XXL and removed size/XL labels Oct 23, 2019
jackkleeman added 2 commits Oct 22, 2019
Reload certificate cert and key file from disk every minute and notify
the dynamic certificate controller when they change, allowing serving
tls config to be updated.
@jackkleeman jackkleeman force-pushed the jackkleeman:dynamic-serving-cert branch from f286865 to 4e99b5d Oct 24, 2019
@k8s-ci-robot k8s-ci-robot added size/L and removed size/XXL labels Oct 24, 2019
}

// check to see if we have a change. If the values are the same, do nothing.
existing, ok := c.servingCert.Load().(*certKeyContent)

This comment has been minimized.

Copy link
@deads2k

deads2k Oct 24, 2019

Contributor

@sttts are you happy with this? I refactored the other one, but this may work.

@jackkleeman you can match the other one and be golden.

@deads2k

This comment has been minimized.

Copy link
Contributor

deads2k commented Oct 24, 2019

I'm convinced by the playground test.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Oct 24, 2019
@deads2k

This comment has been minimized.

Copy link
Contributor

deads2k commented Oct 24, 2019

/lgtm
/approve
/ok-to-test
/refresh
/skip
/retest
/do-wtf-i-want-and-merge-it

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Oct 24, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, jackkleeman

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

@jackkleeman

This comment has been minimized.

Copy link
Member Author

jackkleeman commented Oct 24, 2019

/retest

@deads2k

This comment has been minimized.

Copy link
Contributor

deads2k commented Oct 24, 2019

/retest
/priority important-soon

@k8s-ci-robot k8s-ci-robot merged commit 04632e8 into kubernetes:master Oct 24, 2019
16 checks passed
16 checks passed
cla/linuxfoundation jackkleeman authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-kind-ipv6 Job succeeded.
Details
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-kind Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
tide In merge pool.
Details
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Oct 24, 2019
if err != nil {
return err
}
if len(cert) == 0 || len(key) == 0 {

This comment has been minimized.

Copy link
@tedyu

tedyu Oct 25, 2019

Contributor

It seems the cert length check can be performed prior to reading keyFile.

@jackkleeman jackkleeman deleted the jackkleeman:dynamic-serving-cert branch Oct 25, 2019
@jackkleeman jackkleeman mentioned this pull request Nov 12, 2019
6 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.