<p>I have installed minikube, kubectl  in my laptop.</p>

<p>When I run <code>kubectl cluster-info</code> in get the below </p>

<pre><code>   Kubernetes master is running at https://10.168.99.10:8443
</code></pre>

<p>when I connect to  <a href="https://10.168.99.10:8443" rel="nofollow noreferrer">https://10.168.99.10:8443</a> I get the below response.</p>

<pre><code>{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  },
  "status": "Failure",
  "message": "Unauthorized",
  "reason": "Unauthorized",
  "code": 401
}
</code></pre>

<p>When installed kubectl/minikube didn't prompt for user/password.
What is the default user/password to connect.</p>

<p><strong>minikube</strong> doesn't start with basic-auth. So there is not username &amp; password for apiserver by default. To access apiserver, you need to use apiserver certificates. That`s how you will be authorized.</p>

<pre><code>curl https://192.168.99.100:8443 --cert ~/.minikube/apiserver.crt  --key ~/.minikube/apiserver.key --cacert ~/.minikube/ca.crt 
</code></pre>

<p><strong>See details:</strong></p>

<p>Get your minikube IP address</p>

<pre><code>$ minikube ip
192.168.99.100
</code></pre>

<p>The API server runs on <code>8443</code> by default</p>

<p>Now try to connect apiserver using this</p>

<pre><code>$ curl https://192.168.99.100:8443  
curl: (60) SSL certificate problem: unable to get local issuer certificate
</code></pre>

<p>Need to provide CA certificate</p>

<pre><code>$ curl https://192.168.99.100:8443  --cacert ~/.minikube/ca.crt 
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  },
  "status": "Failure",
  "message": "Unauthorized",
  "reason": "Unauthorized",
  "code": 401
}⏎ 
</code></pre>

<p>Now you need to provide apiserver SSL certificate and key</p>

<pre><code>curl https://192.168.99.100:8443 --cert ~/.minikube/apiserver.crt  --key ~/.minikube/apiserver.key --cacert ~/.minikube/ca.crt 
{
  "paths": [
    "/api",
    "/api/v1",
    ....
    "/ui",
    "/ui/",
    "/version"
  ]
}⏎
</code></pre>

<blockquote>
  <p>Note: You can proxy apiserver too</p>
</blockquote>

<pre><code>$ kubectl proxy --port=8433
$ curl 127.0.0.1:8433
</code></pre>

<p>Now you do not need to provide any certificates. And you are authorized</p>
