<p>i'm getting an error when running kubectl one one machine (windows)</p>

<p>the k8s cluster is running on CentOs 7 kubernetes cluster 1.7
master, worker</p>

<p>Here's my .kube\config</p>

<pre>
  <code>
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: REDACTED
    server: https://10.10.12.7:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: system:node:localhost.localdomain
  name: system:node:localhost.localdomain@kubernetes
current-context: system:node:localhost.localdomain@kubernetes
kind: Config
preferences: {}
users:
- name: system:node:localhost.localdomain
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
  </code>
</pre>

<p>the cluster is built using kubeadm with the default certificates on the pki directory</p>

<p>kubectl unable to connect to server: x509: certificate signed by unknown authority</p>

<p>One more solution in case it helps anyone:</p>

<p><strong>My scenario:</strong></p>

<ul>
<li>using Windows 10</li>
<li>Kubernetes installed via Docker Desktop ui 2.1.0.1</li>
<li>the installer created config file at <code>~/.kube/config</code></li>
<li>the value in <code>~/.kube/config</code> for <code>server</code> is <code>https://kubernetes.docker.internal:6443</code> </li>
<li>using proxy</li>
</ul>

<p><strong>Issue:</strong> <code>kubectl</code> commands to this endpoint were going through the proxy, I figured it out after running <code>kubectl --insecure-skip-tls-verify cluster-info dump</code> which displayed the proxy html error page.</p>

<p><strong>Fix:</strong> just making sure that this URL doesn't go through the proxy, in my case in bash I used <code>export no_proxy=$no_proxy,*.docker.internal</code></p>
