Welcome to the Linux Foundation Forum!

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

I am running the EC2 instances for the control plane and worker node (instance has all the ports open and it has 4cpus)

I had built a cluster using the kubeadm with a 1-node cluster and all the setup is completed once I had executed the command (kubectl get nodes) it was working fine after some time this command was not working and getting this error

Error message -The connection to the server 172.31.13.184:6443 was refused - did you specify the right host or port?

Crossed checked with all the K8s components all are running correctly
kubelet,kubeadm, containerd all are running

I browsed google and I found the solution mentioned below and used that command to solve this issue but it gave only a temporary solution for some time
it was working and again getting the same error

sudo -i
swapoff -a
exit

can anyone please help me in solving this issue?

Error message Pic

.kube/config file pic

Answers

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training