A Simple Kubernetes Admission Webhook
Dec 14, 2021

Summary
This post details the implementation of a simple, stateless Kubernetes admission webhook in Go. It explains the core concepts of admission controllers and webhooks, and provides a practical example of creating both validating and mutating webhooks. The post covers the Kubernetes configuration required for deploying and registering the webhook (Deployment, Service, Secret, ValidatingWebhookConfiguration, MutatingWebhookConfiguration) and the Go code for handling admission requests, including parsing `AdmissionReview` objects and returning `AdmissionResponse`.