-
Notifications
You must be signed in to change notification settings - Fork 68
🐛 Fix webhook issue when there are multiple replication of controller #217
🐛 Fix webhook issue when there are multiple replication of controller #217
Conversation
Hi @vincent-pli. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vincent-pli The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
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.
Rather than implementing this way can we maybe make this about removing the self-signing of certificates and setup the kustomize configs to auto annotate the controller to use a cert-manager based certificate like we get with normal Kubebuilder/controller runtime deployments?
@christopherhein I'm OK for both solution. |
Yes, but the idea behind moving away from the vc manager auto publishing the validatingwebhookconfiguration it's self and delegating that to the configuration will make this controller work "properly" eg as you found you can't have multiple replicas cause it independently deploys separate self-signed certs, we need a layer above at provisioning that writes the cert for us so we can just use it. By moving to |
+1 to cert-manager. Better to rely on a project designed to handle certs for handling certs. And, cluster api already depends on it. |
We don't need to force users to use cert-manager but we should expect that if they choose not to use it that they manage certificates themselves. |
I would take inspiration from a default scaffolded kubebuilder project or even how the capn base project is setup with the configs/ directory it will use kustomize to auto-inject the right information but allows a user to also "opt out" of using cert-manager. |
I agree with building cert-manager integration for cert management in CAPN. Coming back to the fix, I think it is ok to have self-cert as long as it works without breaking fundamental architecture. We just don't recommend people to handle cert this way and provide cert-manager option next. |
I think the no-op that this is causing users is that if they use the So right now the architecture doesn't allow vc-manager to run as more than one replica for higher availability. |
@christopherhein thanks for your comments. For |
Hmm, are you sure? I am 90% sure when you use the |
Maybe you could provide some samples showing a curl to the webhook endpoint on a non-leader running in a cluster then show the same against the leader and that would help me. |
I test in my env, it doesn't work because virtualcluster-webhook-service use selector: virtualcluster-webhook=true. |
You should be able to port-forward and then curl the pod on the webhook port and see if it's listening. |
Thanks @christopherhein, I 100% use the The fix just resolve the conflict of cert generated but I forget the There is several solution to resolve the problem(as @crazywill mentioned) but I think the easiest way is to adopt |
Agreed, how do you want to handle this, did you want to use this PR to move over to cert-manager based? |
No, I think we should have another one, this one will be close |
Sounds good, thank you! Make sure to take a look at the CAPN config directory for inspiration and direction so that it will auto-deploy everything for you. |
Check out #194 for when that was implemented. |
What this PR does / why we need it:
#215
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #