Replies: 4 comments 2 replies
-
We use knative webhook scaffolding for managing cert autorotation. It is the default webhook implementation for Karpenter. It looks slightly different from kubebuilder scaffolding but I found it is convenient and reliable. |
Beta Was this translation helpful? Give feedback.
-
@cvvz @Fei-Guo I have developed webhooks based on controller-runtime instead of kubebuilder and knative in grit, and solved the certificate rotation. Btw: I think this implementation have obtained the benefits from OpenYurt and Karpenter, and prevent their shortages. |
Beta Was this translation helpful? Give feedback.
-
@rambohe-ch I reviewed your implementation of the cert rotation part and didn’t find any issues. You used a separate reconciler to check whether the certificate is expired, and also used reconcile.Result{RequeueAfter: timeUntilNextCheck} to periodically trigger the cert reconcile process — that’s a very thorough approach. Btw, if it were me, I might consider directly using something like cert-controller or cert-manager — I’m too lazy and don’t want to implement the reconciler myself. But since you’ve already implemented a good one by yourself, I don’t think there’s any need to change it. As for the webhook implementation itself, I think if you're familiar with controller-runtime, it should be fine to not rely on the Kubebuilder scaffolding to auto-generate the webhook code, although IMO the code-generation is helpful, especially when we want to change the api and generate the manifest. Using Kubebuilder/controller-runtime to implement the webhook can help simplify the code. For example, in the current Kaito webhook, it uses the client which is a global variable copied from mgr.GetClient() . By using controller-runtime, we can just use |
Beta Was this translation helpful? Give feedback.
-
@cvvz Thanks for your detailed response.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Currently, the webhook is implemented by knative library. I suggest to refactor by using kubebuilder webhook scaffolding, which is the common practice for building operator. And in this way, we can make the webhook code consistent with controller code and avoid using a third-party libraries.
I'm not familiar with knative and maybe I didn't get the advantage of using knative to build webhook ranther than kubebuilder. I'm open to discuss this further.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
Beta Was this translation helpful? Give feedback.
All reactions