I have configured a kubernetes cluster on a server(ubuntu 22.04) with two network interfaces. I am using IP on one of the interfaces as api server using --apiserver-advertise-address. after kubeadm init was run I noticed SSL certificates were issued to server name and also localhost.
[certs] Generating "etcd/server" certificate and key[certs] etcd/server serving cert is signed for DNS names [kubemaster localhost] and IPs [192.168.100.40 127.0.0.1 ::1][certs] Generating "etcd/peer" certificate and key[certs] etcd/peer serving cert is signed for DNS names [kubemaster localhost] and IPs [192.168.100.40 127.0.0.1 ::1]
The worker nodes joined without issues, checked .kube/config and it shows the IP address I used for --apiserver-advertise-address.
I see the following errors when running kubectl get nodes:
45560 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refusedThe connection to the server localhost:8080 was refused - did you specify the right host or port?
I have even tried to remove mention of 127.0.0.1 from all manifests files, still getting the same error but like this
45802 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?
wondering why localhost is being contacted even though configuration mentions 192.168.100.40 as the api server.
it is described in the problem detail already