Tools for building and registering Kubernetes admission webhooks
The library ezadmis
can reduce the complexity of writing a kubernetes admission webhook
.
All things you have to do is to implement a handler function.
type WebhookHandler func(ctx context.Context, req *admissionv1.AdmissionRequest, rw WebhookResponseWriter) (err error)
- Parameters
ctx
, context of incoming requestrequest
, incomingAdmissionRequest
patches
, an optional output of JSONPatch operations for mutating webhook
- Return Values
deny
, if not empty, indicating thisAdmissionRequest
should be denied, and a message will be returnederr
, error occurred
This repository provides two important tools
-
Reduce the complexity of installing an admission webhook
-
Print the incoming
AdmissionReview
request for debugging
See https://github.com/yankeguo/ezadmis-extra
GUO YANKE, MIT License