<p>When using Kubernetes Admission Controllers <a href="https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/" rel="nofollow noreferrer">ValidatingWebhookConfiguration</a>, I'd like to skip the interception of internal requests such as <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/" rel="nofollow noreferrer">Kubernetes Controllers</a>.</p>
<p>More specifically, the only requests that I want the validation webhook to match are users' requests via the Kubctl/API, etc.</p>
<p>Is it possible?</p>

tomikos
<p>According to <a href="https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#webhook-request-and-response" rel="nofollow noreferrer">Webhook request and response</a> your webhook will receive an <a href="https://github.com/kubernetes/api/blob/master/admission/v1beta1/types.go#L34" rel="nofollow noreferrer">AdmissionRequest</a> object which contains <a href="https://github.com/kubernetes/api/blob/2a5dae08c42b1e8fdc1379432d8898efece65363/authentication/v1/types.go#L107" rel="nofollow noreferrer">UserInfo</a> field. In it, there are fields like <code>Username</code>, <code>Groups</code> and others that might be useful for solving your problem.</p>
<pre><code>...
    &quot;userInfo&quot;: {
      # Username of the authenticated user making the request to the API server
      &quot;username&quot;: &quot;admin&quot;,
      # UID of the authenticated user making the request to the API server
      &quot;uid&quot;: &quot;014fbff9a07c&quot;,
      # Group memberships of the authenticated user making the request to the API server
      &quot;groups&quot;: [&quot;system:authenticated&quot;,&quot;my-admin-group&quot;],
      # Arbitrary extra info associated with the user making the request to the API server.
      # This is populated by the API server authentication layer and should be included
      # if any SubjectAccessReview checks are performed by the webhook.
      &quot;extra&quot;: {
        &quot;some-key&quot;:[&quot;some-value1&quot;, &quot;some-value2&quot;]
      }
    },
...
</code></pre>
