<p>I am deployment a kubernetes v1.22.3 cluster using kubeadm, today when I access api-server from public domain, shows error like this:</p>
<pre><code>2021/08/04 11:20:19 http: proxy error: x509: certificate is valid for 10.96.0.1, 172.29.217.209, not 107.124.83.31
</code></pre>
<p><code>10.96.0.1</code> is my kubernetes cluster ip address, <code>172.29.217.209</code> is my host internal ip address. <code>107.124.83.31</code> is my public domain ip address. how to add the public ip <code>107.124.83.31</code> into the certificate so that I could access api server from public domain?</p>

Dolphin
<p>you shoud add IPs and domains of APIServer to <code>certSANs</code> in <code>ClusterConfiguration</code> of kubeadm config and <code>kubeadm init --config=&lt;kubeadm-config-file&gt;</code>.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
apiServer:
  certSANs: ['localhost','127.0.0.1'] 
  ...
</code></pre>
