I have deployed kubernetes cluster on AWS EC2 Ubuntu Nodes, one master node and one worker node. Its a free tier t2.micro machine with 1 CPU.
I installed and configured everything and on day 1 everything works fine. kubectl get nodes
command was responding without any delay and i was able to create MYSQL deployment.
Next day when i tried kubectl get nodes
i was getting The connection to the server :6443 was refused - did you specify the right host or port? and even sometimes i am getting Unable to connect to the server: net/http: TLS handshake timeout
I checked the following things to verify whether kubernetes is working or not
sudo systemctl status kubelet
it was in active status
Even its surprising that sometime kubectl get nodes
works perfectly and sometime it return The connection to the server :6443 was refused - did you specify the right host or port?
I am not able to understand how to fix this issue ?