<p>I have a kubernetes cluster setup on AWS using kops.</p>

<p>Right now, the server url is <a href="https://old-server-url.com" rel="nofollow noreferrer">https://old-server-url.com</a>.
This url is configured on Route53 pointing to public ip of master instance of cluster.</p>

<p>I want to change this to <a href="https://new-server-url.com" rel="nofollow noreferrer">https://new-server-url.com</a>.
I configured new url on Route53 same with master IP. But it just opens the kubernetes dashboard with new URL.
I can't access kubernetes server via kubectl with this url.</p>

<p>This is the error I get when changing the kubeconfig file with new url and running kubectl get pods command.</p>

<p><code>"Unable to connect to the server: x509: certificate is valid for internal.old-server-url.com, old-server-url.com, kubernetes, kubernetes.default, kubernetes.default.svc, kubernetes.default.svc.cluster.local, not new-server-url.com"</code></p>

<p>What configuration do I have to change so that only the server of kubernetes cluster is changed, and I can access it via kube config/ kubectl?</p>

<p>Update:
I can access my cluster after using --insecure-skip-tls-verify flag along the kubectl command. But this is insecure. I would like to know how can I change my certficates in a kops provisioned cluster with minimal effects for this scenario.</p>

rahim
<p>To just resolve the error:</p>

<pre><code>"Unable to connect to the server: x509: certificate is valid for internal.old-server-url.com, old-server-url.com, kubernetes, kubernetes.default, kubernetes.default.svc, kubernetes.default.svc.cluster.local, not new-server-url.com"
</code></pre>

<p>You can use the --insecure-skip-tls-verify flag with kubectl command as explained here: <a href="https://stackoverflow.com/questions/46360361/invalid-x509-certificate-for-kubernetes-master">Invalid x509 certificate for kubernetes master</a></p>

<p>This is not recommended for production environments.</p>
