This project implements a Kubernetes admission webhook that receives StatefulSet update events. If the volume claim template PVC size of a StatefulSet is increased (by comparing against the last-applied-configuration), the admission webhook will perform an orphan delete operation on the Kubernetes StatefulSet.
Introduction
The StatefulSet Admission Webhook is a Kubernetes admission controller designed to enforce specific policies on StatefulSet updates. It ensures that volume claim template PVC size increases are handled properly by performing an orphan delete operation on affected StatefulSets.
Installation
Prerequisites
Kubernetes cluster (version X.X.X or later)
kubectl configured to access the Kubernetes cluster
Steps
Clone this repository:
git clone <repository-url>
Deploy the admission webhook to your Kubernetes cluster:
kubectl apply -f deployment.yaml
Verify that the admission webhook is running:
kubectl get pods -n <namespace>
Usage
Make changes to the volume claim template PVC size in a StatefulSet.
Check the logs of the admission webhook to see if the orphan delete operation was triggered: