The connection to the server <master>:6443 was refused - did you specify the right host or port

6/9/2021

I came to this error after a long time from the cluster set up.

kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T19:18:23Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server 192.168.33.223:6443 was refused - did you specify the right host or port?

sudo journalctl -xeu kubelet,I get the errors:

-- The start-up result is RESULT.
Jun 03 17:44:08 nandoc-93 kubelet[19824]: Flag --cgroup-driver has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more informati
Jun 03 17:44:08 nandoc-93 kubelet[19824]: Flag --resolv-conf has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information
Jun 03 17:44:08 nandoc-93 kubelet[19824]: Flag --cgroup-driver has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more informati
Jun 03 17:44:08 nandoc-93 kubelet[19824]: Flag --resolv-conf has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information
Jun 03 17:44:08 nandoc-93 kubelet[19824]: I0603 17:44:08.892580   19824 server.go:410] Version: v1.16.2
Jun 03 17:44:08 nandoc-93 kubelet[19824]: I0603 17:44:08.892775   19824 plugins.go:100] No cloud provider specified.
Jun 03 17:44:08 nandoc-93 kubelet[19824]: I0603 17:44:08.892790   19824 server.go:773] Client rotation is on, will bootstrap in background
Jun 03 17:44:08 nandoc-93 kubelet[19824]: E0603 17:44:08.894470   19824 bootstrap.go:265] part of the existing bootstrap client certificate is expired: 2020-11-12 06:41:08 +0000 UTC
Jun 03 17:44:08 nandoc-93 kubelet[19824]: F0603 17:44:08.894491   19824 server.go:271] failed to run Kubelet: unable to load bootstrap kubeconfig: stat /etc/kubernetes/bootstrap-kubelet.conf: no such file or directory
Jun 03 17:44:08 nandoc-93 systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Jun 03 17:44:08 nandoc-93 systemd[1]: kubelet.service: Failed with result 'exit-code'.

then use 'kubeadm alpha certs renew all' to update the certificate.file /etc/kubernetes/kubelet.conf is updated.

But this error still not be resolved.

-- clara
kubectl
kubernetes

0 Answers