Policy decisions rely solely on the incoming admission review request body at present. However a more dynamic approach is preferred:
- we should implement custom casbin functions to query the live kubernetes cluster state;
- it will allows policies to verify global constraints such as total pod counts;
- furthermore integrating a kubernetes client within the enforcer helps fetch related resources dynamically;
- caching frequent queries is also recommended to minimize api server load and latency;
- consequently these improvements empower complex policies that require a broader cluster context.