Kubebuilder: Can create Mutating webhook for k8s native resource in v2?

Created on 21 Nov 2019  Â·  3Comments  Â·  Source: kubernetes-sigs/kubebuilder

/triage support

kinsupport

Most helpful comment

In kubebuilder v2, you can create mutating webhook for custom resource Sloop using following cmd. It's convenient that you only need implement method Default for Sloop.

kubebuilder create webhook --kind=Sloop  --version=v1beta1 --defaulting

But, How to create mutating webhook for k8s native resource(for example: Pod)。

I find an example in controller-runtime, is this the best way to create mutating webhook for k8s native resource in kubebuilder v2?

All 3 comments

In kubebuilder v2, you can create mutating webhook for custom resource Sloop using following cmd. It's convenient that you only need implement method Default for Sloop.

kubebuilder create webhook --kind=Sloop  --version=v1beta1 --defaulting

But, How to create mutating webhook for k8s native resource(for example: Pod)。

I find an example in controller-runtime, is this the best way to create mutating webhook for k8s native resource in kubebuilder v2?

I find an example in controller-runtime, is this the best way to create mutating webhook for k8s native resource in kubebuilder v2?

Yes.
We currently doesn't scaffold webhooks for k8s native types.

Thanks

Was this page helpful?
0 / 5 - 0 ratings