I am trying to set up Kubernetes on AWS. I took two instances one for master and one for slave.
Master and slave node i installed all the dependencies. After kubeadm init I got the token and run the command on my slave instance but every time it gives a connection refused error.
error execution phase preflight: couldn't validate the identity of the API Server: Get "https://172.31.1.246:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s": dial tcp 172.31.1.246:6443: connect: connection refused
To see the stack trace of this error execute with --v=5 or higher
I allow the port on the AWS security group but still I am getting this error. Please help me
Thank you for your question, it’s an interesting one apparently the slave can’t access to API server on port 6443.
If the Api-server is up and running correctly on ControlPlane, you need to
check the firewall by default on ubuntu is not active
as you are on AWS check the security group linked to your instance by default AWS authorize only ssh port, you can authorize all ports like the screenshot below :