<p>I am having trouble trying to understand the Kubernetes authentication model, specially what "users" are.</p>

<p>Suppose I am on a computer, which is inside a kubernetes cluster. I want to do a request to the API server, using <code>kubectl</code>.</p>

<p>So:
- I need to have the public key from the api-server HTTPS port. So let's assume that is provided to me.
- Then, in my requeste, there's a need for me to populate the "user" field?</p>

<p>As per this part of the documentation, the user field is a method: <a href="https://kubernetes.io/docs/admin/authentication/#authentication-strategies" rel="nofollow noreferrer">https://kubernetes.io/docs/admin/authentication/#authentication-strategies</a></p>

<p>But then here <a href="https://kubernetes.io/docs/admin/accessing-the-api/#authorization" rel="nofollow noreferrer">https://kubernetes.io/docs/admin/accessing-the-api/#authorization</a> we read that actually kubernetes has no concept of a user.</p>

<p>So:</p>

<ul>
<li>What/where do I even put in the user field?</li>
<li>If, since I control the client request content, couldn't I simply enter any username there? Couldn't I just try guess any username repeatedly until I find one with the authorisation for what I want?</li>
</ul>

<p>Thanks.</p>

<p>The user to be used depends on the kubeconfig for you to use (e.g. ~/.kube/config) and the current context. For example if your ~/.kube/config is below, kubernetes-admin is the user.</p>
<pre><code>apiVersion: v1
kind: Config
current-context: kubernetes-admin@kubernetes
preferences: {}

contexts:
  - context:       &lt;---- Current context to identify which cluster, user, and namespace (*) to use.
      cluster: kubernetes
      user: kubernetes-admin   &lt;----- user for the context
    name: kubernetes-admin@kubernetes

clusters:
  - cluster:
      certificate-authority-data: REDACTED
      server: https://172.31.4.117:6443 
    name: kubernetes

users:
  - name: kubernetes-admin &lt;----
    user:
      client-certificate-data: REDACTED
      client-key-data: REDACTED
</code></pre>
<p>You can add users. Please refer to Use Case 1: Create User With Limited Namespace Access in <a href="https://docs.bitnami.com/kubernetes/how-to/configure-rbac-in-your-kubernetes-cluster/" rel="nofollow noreferrer">Configure RBAC In Your Kubernetes Cluster</a>. This &quot;User&quot; is not &quot;service account&quot;.</p>
<hr />
<h1 id="references-5we4">References</h1>
<ul>
<li><a href="https://docs.bitnami.com/tutorials/configure-rbac-in-your-kubernetes-cluster/" rel="nofollow noreferrer">Configure RBAC in your Kubernetes Cluster</a></li>
<li><a href="https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/" rel="nofollow noreferrer">Configure Access to Multiple Clusters</a></li>
</ul>
