Adding new load-balancer to kubernetes x509 certificate

Hello!

I’m running a k8s cluster in AWS and I’ve created a new load-balancer that will be used to access the cluster via kubectl. I’ve update the kubeconfig with the new url but I run in to the following issue when trying to run any kubectl command:

Unable to connect to the server: x509: certificate is valid for…etcetc

I’m a bit unsure of how I can add the new load-balancer to the certificate or renew the certificate so that it includes it. Any help is welcome, thanks in advance! (edited)

1 Like

Experiencing the same problem, I already tried to use --apiserver-cert-extra-sans

sudo kubeadm init --control-plane-endpoint dedicatedloadbalancerdns.com:443 --kubernetes-version v1.21.2 --pod-network-cidr 10.244.0.0/16 --cri-socket /run/containerd/containerd.sock --upload-certs --apiserver-cert-extra-sans=dedicatedloadbalancerdns.com,localhost,existingmaster.com,additionamaster1.com,additionalmaster2.com --apiserver-bind-port=443