Welcome to the Linux Foundation Forum!

GCE worker node not working after a day

Hi, I have setup both master and worker nodes in GCE as per the initial setup details and with class resources (k8sMaster.sh and K8sSecond.sh). After this I used to kubeadm join command from master node output to join worker node to the cluster.

It works fine for a day and if I reconnect to worker node (using putty) after that and try to execute any kubectl command like get pods, I keep getting below error.
"The connection to the server localhost:8080 was refused - did you specify the right host or port?"

Has any one else faced this issue and know how to resolve this? I tried 2 times setting up entire thing again from scratch but still this problem resurfaces after a day or two.

Best Answer

  • chrispokornichrispokorni Posts: 1,026
    Accepted Answer

    Hi @tlf4pundari,

    The lab exercise only configures kubectl to work from the master/ckad-1 node, and not from the worker/ckad-2 node.
    Did you find in the lab any step where a successful kubectl command was issued from the worker/ckad-2 node?



  • Hi chrispokorni,

    Thank you for the clarification. I was doing it in incorrect terminal of worker node instead of master node.


  • nkerrnkerr Posts: 9
    edited May 5

    unless I'm mistaken, Lab 7.1 problem 9 requires this?
    Step 8 required curl to the ClusterIP ( which is different from the following. Not sure how this is executed unless with kubectl on worker node to discover this elusive alternative IP as shown below.

    9. Test access from an external node to the host IP and the high container port. Your IP and port will be different. It shouldwork, even with the network policy in place, as the traffic is arriving via a port.
    [email protected]: ̃/Desktop$ curl
  • chrispokornichrispokorni Posts: 1,026

    Hi @nkerr,

    If you look closely at Step 7, that is where you uncover the value of the ClusterIP address of the secondapp Service resource, the one specific to your cluster, which will be different than the one presented in the lab guide. So in Step 8 you are expected to curl the ClusterIP extracted in Step 7, and then in Step 9 you wold curl the public IP of one of your hosts/nodes paired with port 32000, and again, your public IP will be different than the one presented in the lab guide.


  • nkerrnkerr Posts: 9

    Thanks Chris

Sign In or Register to comment.