<p>I want to validate the deployment yaml based on certain rules on EKS.
Like if there is no field of nodeselector then kubernetes should reject that deployment.</p>

Ajitesh Shukla
<p>Your use case is a clear fit for the <a href="https://github.com/open-policy-agent/opa" rel="nofollow noreferrer">Open Policy Agent</a>.</p>
<p>You need to deploy it as a <a href="https://github.com/open-policy-agent/opa" rel="nofollow noreferrer">Validating Web Hook</a> to your K8s cluster and configure <a href="https://www.openpolicyagent.org/docs/latest/policy-language/" rel="nofollow noreferrer">Rego Rules</a> to define the K8s Yaml format you want to mandate.</p>
