API endpoints for kubernetes mutating webhook server API endpoints for kubernetes mutating webhook server kubernetes kubernetes

API endpoints for kubernetes mutating webhook server


I see you are trying to understand what is the ordering of execution of mutating webhooks.

I have found this piece of code in kubernetes repo. Based on this you can see that these are sorted by name of a webhook to have a deterministic order.

A single ordering of mutating admissions plugins (including webhooks) does not work for all cases, so take a look at mutating plugin ordering section in Admission webhook proposal for explanation how its handled.

Also notice there are no "pod only endpoints" or "endpoints that get called for pods". Let's say you have your webhook server and want to mutate pods and your server has only one endpoint: /. If you want to mutate pods with it you need to specify it under rules. So setting rules[].resources: ["pods"] and rules[].operations: ["CREATE"] in your webhook config will run your mutating webhook whenever there is pod to be created.

Let me know it it helped.