-
Notifications
You must be signed in to change notification settings - Fork 877
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
Set the required RBAC to enable the certificate signing request #2357
Conversation
I've been busy lately and have missed a lot of information. Looks like the |
b351596
to
67d5d3a
Compare
Does this ready for review? |
Ok, I will fix it ASAP. |
4044c06
to
2dfa965
Compare
/cc @RainbowMango |
@@ -65,7 +65,6 @@ func (i *CommandInitOption) karmadaAPIServerContainerCommand() []string { | |||
"--allow-privileged=true", | |||
"--authorization-mode=Node,RBAC", | |||
fmt.Sprintf("--client-ca-file=%s/%s.crt", karmadaCertsVolumeMountPath, options.CaCertAndKeyName), | |||
"--enable-admission-plugins=NodeRestriction", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember why we need the NodeRestriction plugin for karmada-apiserver
. @mrlihanbo can you remind me?
@lonelyCZ Can you explain why you remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly lease is restricted at kube-node-lease
namespace.
I0822 07:30:51.558065 1 leaderelection.go:253] failed to acquire lease karmada-system/karmada-agent-member68
E0822 07:30:54.921883 1 leaderelection.go:367] Failed to update lock: leases.coordination.k8s.io "karmada-agent-member68" is forbidden: can only access leases in the "kube-node-lease" system namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it can only use system:node:
CN and system:nodes
OG for agent cert, to reuse the controller of automatically approving csr.
@@ -268,7 +267,7 @@ func (i *CommandInitOption) makeKarmadaKubeControllerManagerDeployment() *appsv1 | |||
fmt.Sprintf("--cluster-name=%s", options.ClusterName), | |||
fmt.Sprintf("--cluster-signing-cert-file=%s/%s.crt", karmadaCertsVolumeMountPath, options.CaCertAndKeyName), | |||
fmt.Sprintf("--cluster-signing-key-file=%s/%s.key", karmadaCertsVolumeMountPath, options.CaCertAndKeyName), | |||
"--controllers=namespace,garbagecollector,serviceaccount-token", | |||
"--controllers=namespace,garbagecollector,serviceaccount-token,ttl-after-finished,bootstrapsigner,tokencleaner,csrapproving,csrcleaner,csrsigning", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these controllers are required controllers or optinal controllers?
Can you explain why they are needed for this feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These controllers are exclusively used by new register workflow. If there aren't the controllers, the new register process prossiblly will be not executed.
I think they are optinal, only enabling new register process need them.
Can you explain why they are needed for this feature?
bootstrapsigner: be used to sign csr automatically.
tokencleaner: be used to clean the tokens that are expired automatically.
csrapproving,csrcleaner,csrsigning: enable csr function.
I will also explain them in the document after this pr.
Signed-off-by: lonelyCZ <531187475@qq.com>
2dfa965
to
59c17d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango 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 |
Signed-off-by: lonelyCZ 531187475@qq.com
What type of PR is this?
/kind feature
What this PR does / why we need it:
Use the
bootstrap token
to createCertificateSigningRequest
The csr can be signed automatically by reusing
kubernetes.io/kube-apiserver-client-kubelet
.Which issue(s) this PR fixes:
Part of #2282
Special notes for your reviewer:
Does this PR introduce a user-facing change?: