title: How do I authenticate with Kubernetes kubectl using a username and password?
body: <p>I've got a username and password, how do I authenticate kubectl with them?</p>
  
  <p>Which command do I run?</p>
  
  <p>I've read through: <a href="https://kubernetes.io/docs/reference/access-authn-authz/authorization/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/access-authn-authz/authorization/</a> and <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/access-authn-authz/authentication/</a> though can not find any relevant information in there for this case.</p>
  
  <hr>
  
  <pre><code>kubectl config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif
  </code></pre>
  
  <p><a href="https://kubernetes-v1-4.github.io/docs/user-guide/kubectl/kubectl_config_set-credentials/" rel="nofollow noreferrer">https://kubernetes-v1-4.github.io/docs/user-guide/kubectl/kubectl_config_set-credentials/</a></p>
  
  <hr>
  
  <p>The above does not seem to work: 
  <code>kubectl get pods<br>
  Error from server (Forbidden): pods is forbidden: User "client" cannot list pods in the namespace "default": Unknown user "client"
  </code></p>