Closed suneelkumarch closed 8 months ago
Operator SDK (and Kubebuilder) doesn't support scaffolding validating/mutating webhooks for default k8s types by default. But it can be done by making some changes manually to the kubebuilder markers that use controller-gen. Here is a documentation on scaffolding admission WHs for pods (it would be similar for deployment): https://book.kubebuilder.io/reference/webhook-for-core-types. Also, controller runtime has an example for this in its repo: https://github.com/kubernetes-sigs/controller-runtime/blob/main/examples/builtins/mutatingwebhook.go
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting /reopen
.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Exclude this issue from closing again by commenting /lifecycle frozen
.
/close
@openshift-bot: Closing this issue.
Type of question
How to implement a specific feature
Question
Using
operator-sdk
CLI is it possible to create an admission(mutating) webhook for k8sDeployment
workload.? Its possible to create web hooks for the CRs those are create usingoperator-sdk
CLI in the same project. But I have requirement to create a mutating webhook for k8s Deployment object under the operator projectWhat did you do?
What did you expect to see?
What did you see instead? Under which circumstances?
Environment
Operator type:
/language go
Kubernetes cluster type:
minikube
$ operator-sdk version
operator-sdk version: "v1.22.2", commit: "da3346113a8a75e11225f586482934000504a60f", kubernetes version: "1.24.1", go version: "go1.18.4", GOOS: "linux", GOARCH: "amd64"
$ go version (if language is Go)
go version go1.20.6 linux/amd64 $ kubectl version
Client Version: v1.28.1 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.27.4