I would like to implement functionality (or even better reuse existing libraries/APIs!) that would intercept a kubectl command to create an object and perform some pre-creation validation tasks on it before allowing kubectl command to proceed.
e.g. check various values in the yaml against external DB for example check a label conforms to the internal naming convention and so on..
Is there an accepted pattern or existing tools etc? Any guidance appreciated