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

Improve certificate manager #1133

Merged
merged 2 commits into from
Jan 12, 2023
Merged

Conversation

rambohe-ch
Copy link
Member

@rambohe-ch rambohe-ch commented Jan 10, 2023

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind enhancement

What this PR does / why we need it:

  1. improve YurtCertficateManager Interface for provides all certificates management.
  2. add func NewCertManagerFactoryWithFnAndStore(), so yurthub can use CertManagerFactory util funcs to generate certs.
  3. add func PickHealthyServer() for MultipleBackendsHealthChecker interface, so rest config manager can get healthy server directly.
  4. add two parameters: --discovery-token-ca-cert-hash and --discovery-token-unsafe-skip-ca-verification for yurthub, so end user can use these parameters and increase security for joining nodes.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

@openyurt-bot
Copy link
Collaborator

@rambohe-ch: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind enhancement

What this PR does / why we need it:

  1. improve YurtCertficateManager Interface for provides all certificates management.
  2. add func NewCertManagerFactoryWithFnAndStore(), so yurthub can use CertManagerFactory util funcs to generate certs.
  3. add func PickHealthyServer() for MultipleBackendsHealthChecker interface, so rest config manager can get healthy server directly.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

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.

@openyurt-bot openyurt-bot added the kind/enhancement kind/enhancement label Jan 10, 2023
@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rambohe-ch

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

@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Merging #1133 (f6a8fd7) into master (0aad742) will increase coverage by 1.40%.
The diff coverage is 59.82%.

@@            Coverage Diff             @@
##           master    #1133      +/-   ##
==========================================
+ Coverage   53.56%   54.97%   +1.40%     
==========================================
  Files          97       96       -1     
  Lines       12877    12582     -295     
==========================================
+ Hits         6898     6917      +19     
+ Misses       5398     5070     -328     
- Partials      581      595      +14     
Flag Coverage Δ
unittests 54.97% <59.82%> (+1.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/util/certmanager/pki.go 19.46% <0.00%> (-0.36%) ⬇️
pkg/yurthub/healthchecker/fake_checker.go 0.00% <0.00%> (ø)
pkg/yurthub/healthchecker/health_checker.go 76.66% <0.00%> (-3.20%) ⬇️
pkg/yurthub/server/server.go 0.00% <0.00%> (ø)
pkg/yurthub/kubernetes/rest/config.go 64.00% <58.33%> (+2.46%) ⬆️
pkg/util/certmanager/factory/factory.go 40.62% <64.70%> (+13.70%) ⬆️
pkg/yurthub/certificate/token/token.go 64.81% <64.81%> (ø)
pkg/controller/certificates/csrapprover.go 20.12% <100.00%> (ø)
pkg/yurthub/server/certificate.go 61.53% <100.00%> (ø)
pkg/yurthub/util/util.go 72.98% <100.00%> (-7.18%) ⬇️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@rambohe-ch rambohe-ch force-pushed the improve-certificate-manager branch from 918dfc4 to 8a21e35 Compare January 10, 2023 11:55
@rambohe-ch
Copy link
Member Author

@Congrool PTAL

@rambohe-ch rambohe-ch force-pushed the improve-certificate-manager branch from 8a21e35 to c0339f4 Compare January 11, 2023 07:28
@rambohe-ch
Copy link
Member Author

@Congrool comments are fixed, PTAL

@Congrool
Copy link
Member

/lgtm

@openyurt-bot openyurt-bot added the lgtm lgtm label Jan 12, 2023
@openyurt-bot openyurt-bot merged commit 5ba736c into master Jan 12, 2023
@rambohe-ch rambohe-ch deleted the improve-certificate-manager branch January 28, 2023 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants